mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-17 14:57:24 +01:00
fixed UI bug. Crash on hot plug/unplug Yubikey or similar
fix:Non-constant range: argument must be an integer literal fix:Generic parameter 'ValueType' shadows generic parameter from outer scope with the same name; this is an error fix:Converting non-sendable function value to '@Sendable (any FileHandleReader, any FileHandleWriter) async -> Bool' may introduce data races
This commit is contained in:
@@ -2,7 +2,7 @@ import Foundation
|
||||
import Combine
|
||||
|
||||
/// Type eraser for SecretStore.
|
||||
public class AnySecretStore: SecretStore {
|
||||
public class AnySecretStore: SecretStore, ObservableObject {
|
||||
|
||||
let base: Any
|
||||
private let _isAvailable: () -> Bool
|
||||
@@ -28,9 +28,11 @@ public class AnySecretStore: SecretStore {
|
||||
_existingPersistedAuthenticationContext = { secretStore.existingPersistedAuthenticationContext(secret: $0.base as! SecretStoreType.SecretType) }
|
||||
_persistAuthentication = { try secretStore.persistAuthentication(secret: $0.base as! SecretStoreType.SecretType, forDuration: $1) }
|
||||
_reloadSecrets = { secretStore.reloadSecrets() }
|
||||
sink = secretStore.objectWillChange.sink { _ in
|
||||
self.objectWillChange.send()
|
||||
}
|
||||
sink = secretStore.objectWillChange
|
||||
.receive(on: DispatchQueue.main) // Ensure updates are received on the main thread
|
||||
.sink { [weak self] _ in
|
||||
self?.objectWillChange.send()
|
||||
}
|
||||
}
|
||||
|
||||
public var isAvailable: Bool {
|
||||
|
||||
Reference in New Issue
Block a user