Fix bugs around selection after creating/deleting/updating keys (#436)

* Fix bug where new secret wouldn't be selected

* Remove keyboard shortcut for deletion
This commit is contained in:
Max Goedjen
2022-12-22 23:29:51 -05:00
committed by GitHub
parent 8679ca3da0
commit 480ef5392d
5 changed files with 14 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ public class SecretStoreList: ObservableObject {
@Published public var stores: [AnySecretStore] = []
/// A modifiable store, if one is available.
@Published public var modifiableStore: AnySecretStoreModifiable?
private var sinks: [AnyCancellable] = []
private var cancellables: Set<AnyCancellable> = []
/// Initializes a SecretStoreList.
public init() {
@@ -41,10 +41,9 @@ extension SecretStoreList {
private func addInternal(store: AnySecretStore) {
stores.append(store)
let sink = store.objectWillChange.sink {
store.objectWillChange.sink {
self.objectWillChange.send()
}
sinks.append(sink)
}.store(in: &cancellables)
}
}