eleven / messenger Public

mac: Settings Eleven section re-checks the session — Sign Out was hidden stale (#440)

Settings owns its own MacHomeSignIn whose sessionExists was read once
at creation; signing in from the first-run hero (or the browser
handoff) left the pane claiming 'Not signed in' with no Sign Out.
Re-read the Keychain whenever the section appears.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Paul Campbell 261d8c286a58b6f73f2c20832e56994ee7645023 parent 45ca27c
1 file changed, +10 −0
  • ios/LChatMac/MacHomeSignIn.swift +10 −0
diff --git a/ios/LChatMac/MacHomeSignIn.swift b/ios/LChatMac/MacHomeSignIn.swift
index 031672f..a3f5f04 100644
--- a/ios/LChatMac/MacHomeSignIn.swift
+++ b/ios/LChatMac/MacHomeSignIn.swift
@@ -68,6 +68,13 @@ final class MacHomeSignIn: ObservableObject {
phase = .idle
}
+ /// Re-read the Keychain session: another surface's model (the first-run
+ /// hero, the browser handoff) may have signed in or out since this one was
+ /// created — Settings' copy went stale and hid its Sign Out button.
+ func refreshSession() {
+ sessionExists = HomeSessionStore.load() != nil
+ }
+
// ---- browser-assisted sign-in ------------------------------------------
// 1Password's native macOS provider returns a PRF that doesn't match its
// own browser extension's (the context backups are wrapped in), so the
@@ -232,6 +239,9 @@ struct HomeSignInSection: View {
}
}
}
+ // Signing in happens on OTHER surfaces too — re-check whenever the
+ // pane shows, so this section never claims "Not signed in" stale.
+ .onAppear { model.refreshSession() }
}
}