Fix inability to edit multiple categories

This commit is contained in:
William Brawner 2021-10-21 20:47:52 -06:00
parent 35f1446e9c
commit e27de144fe
2 changed files with 6 additions and 0 deletions

View file

@ -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

View file

@ -78,6 +78,8 @@ struct CategoryFormSheet: View {
archived: false archived: false
)) ))
}) })
}.onDisappear {
self.categoryDataStore.clearSelectedCategory()
} }
} }