fix: VaultViewModel forwards session objectWillChange explicitly
Prevents EntryListView refresh from relying on an implicit SwiftUI re-render cascade through ContentView; now vaultVM itself publishes when session.database changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
This commit is contained in:
@@ -10,9 +10,13 @@ final class VaultViewModel: ObservableObject {
|
|||||||
@Published var errorMessage: String?
|
@Published var errorMessage: String?
|
||||||
|
|
||||||
let session: VaultSession
|
let session: VaultSession
|
||||||
|
private var sessionCancellable: AnyCancellable?
|
||||||
|
|
||||||
init(session: VaultSession) {
|
init(session: VaultSession) {
|
||||||
self.session = session
|
self.session = session
|
||||||
|
sessionCancellable = session.objectWillChange.sink { [weak self] in
|
||||||
|
self?.objectWillChange.send()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// All entries in the vault, flattened with their group breadcrumb, before any filtering.
|
/// All entries in the vault, flattened with their group breadcrumb, before any filtering.
|
||||||
|
|||||||
Reference in New Issue
Block a user