Fix inability to edit multiple categories
This commit is contained in:
parent
35f1446e9c
commit
e27de144fe
2 changed files with 6 additions and 0 deletions
|
@ -100,6 +100,10 @@ class CategoryDataStore: ObservableObject {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func clearSelectedCategory() {
|
||||||
|
self.category = .failure(.unknown)
|
||||||
|
}
|
||||||
|
|
||||||
private let categoryRepository: CategoryRepository
|
private let categoryRepository: CategoryRepository
|
||||||
init(_ categoryRepository: CategoryRepository) {
|
init(_ categoryRepository: CategoryRepository) {
|
||||||
self.categoryRepository = categoryRepository
|
self.categoryRepository = categoryRepository
|
||||||
|
|
|
@ -78,6 +78,8 @@ struct CategoryFormSheet: View {
|
||||||
archived: false
|
archived: false
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
}.onDisappear {
|
||||||
|
self.categoryDataStore.clearSelectedCategory()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue