Sets default names for skills and damage types to an empty string.
This commit is contained in:
@@ -18,7 +18,7 @@ class DamageTypeViewModel: ObservableObject, Comparable, Identifiable {
|
|||||||
|
|
||||||
@Published var name: String
|
@Published var name: String
|
||||||
|
|
||||||
init(_ name: String) {
|
init(_ name: String = "") {
|
||||||
self.name = name
|
self.name = name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ struct EditDamageTypes: View {
|
|||||||
.toolbar(content: {
|
.toolbar(content: {
|
||||||
Button(
|
Button(
|
||||||
action: {
|
action: {
|
||||||
let newDamageType = DamageTypeViewModel("New Type")
|
let newDamageType = DamageTypeViewModel()
|
||||||
viewModel[keyPath: path].append(newDamageType)
|
viewModel[keyPath: path].append(newDamageType)
|
||||||
viewModel[keyPath: path] = viewModel[keyPath: path].sorted()
|
viewModel[keyPath: path] = viewModel[keyPath: path].sorted()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ struct EditSkills: View {
|
|||||||
Button(
|
Button(
|
||||||
action: {
|
action: {
|
||||||
let newSkill = SkillViewModel()
|
let newSkill = SkillViewModel()
|
||||||
newSkill.name = "New Skill"
|
newSkill.name = ""
|
||||||
|
newSkill.proficiency = .proficient
|
||||||
monsterViewModel.skills.append(newSkill)
|
monsterViewModel.skills.append(newSkill)
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
|
|||||||
Reference in New Issue
Block a user