mirror of
https://github.com/yattee/yattee.git
synced 2026-10-27 15:07:18 +00:00
Tell the views when a credential is replaced
Signing in again as a different person on the same server changes neither the account ID, the context, nor usually the status — so nothing the views observe moved, and the previous user's subscriptions and feed stayed on screen while actions went out under the new credential. There is now a notification for exactly that, and the subscriptions view and the instance browser discard and reload on it. An account deleted after its instance disappeared retires its legacy Keychain item too. Identifying that item needs the instance, but checking it does not: the adoption marker is specific to service, account, scope and the exact secret, so asking both managers retires it if either owns it and does nothing otherwise.
This commit is contained in:
@@ -527,6 +527,12 @@ struct SubscriptionsView: View {
|
||||
.onReceive(NotificationCenter.default.publisher(for: .instancesDidChange)) { _ in
|
||||
reloadIfEffectiveContextMoved()
|
||||
}
|
||||
// Signing in again keeps the same account and context, so
|
||||
// nothing above would fire — but the data on screen may now
|
||||
// belong to a different person on that server.
|
||||
.onReceive(NotificationCenter.default.publisher(for: .accountCredentialDidChange)) { _ in
|
||||
reloadForContextChange()
|
||||
}
|
||||
.task(id: instanceConfigurationID) {
|
||||
LoggingService.shared.debug("SubscriptionsView task triggered, instanceConfigurationID: \(instanceConfigurationID)", category: .general)
|
||||
await loadSubscriptionsAsync()
|
||||
|
||||
Reference in New Issue
Block a user