fix(native): mail-sheet modal-conflict + google-oauth picker + feed-bg contrast

- mail/MailAccountSettingsSheet: handleSaveTitle + handleSavePassword now
  dismiss sheet FIRST, then trigger parent SuccessAlert via setTimeout(350ms).
  Fixes iOS "already presenting" crash + page-freeze when editing mailbox name.
  Also fixes double-click-needed UX bug.
- stores/auth: signOut adds WebBrowser.coolDownAsync() to clear OAuth cookies.
  signInWithOAuth for Google adds prompt=select_account — forces account-picker
  on every sign-in attempt instead of auto-reusing previous account.
- app/(app)/index: feed page uses colors.groupedBg instead of colors.bg —
  matches iOS Mail/Messages list-style, post-cards stand out clearer.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
chahinebrini 2026-05-15 21:16:34 +02:00
parent 804d4a5861
commit d55cbc11b2
3 changed files with 22 additions and 7 deletions

View File

@ -80,7 +80,7 @@ export default function HomeScreen() {
);
return (
<View style={{ flex: 1, backgroundColor: colors.bg }}>
<View style={{ flex: 1, backgroundColor: colors.groupedBg }}>
<AppHeader />
<FlatList

View File

@ -257,8 +257,12 @@ export function MailAccountSettingsSheet({
async function handleSaveTitle() {
const ok = await saveTitle(account.id, titleDraft);
if (ok) {
onTitleSaved(titleDraft.trim() || null);
setMode('list');
const newTitle = titleDraft.trim() || null;
// Sheet ZUERST dismissen, dann nach Animation-Complete Parent informieren.
// Sonst rendern Sheet (closing) + SuccessAlert (opening) gleichzeitig → iOS
// wirft „already presenting"-Crash + Page-Freeze. ~350ms = FormSheet-Dismiss.
handleClose();
setTimeout(() => onTitleSaved(newTitle), 350);
}
}
@ -266,10 +270,10 @@ export function MailAccountSettingsSheet({
setLocalError(null);
const result = await connect({ email: account.email, password: passwordDraft });
if (result.ok) {
setPasswordDraft('');
setPasswordVisible(false);
onPasswordSaved();
setMode('list');
// Symmetrisch zu handleSaveTitle: Sheet zuerst dismissen, dann nach
// Animation-Complete Parent informieren — sonst Modal-Conflict-Crash.
handleClose();
setTimeout(() => onPasswordSaved(), 350);
} else {
setLocalError(result.error ?? t('mail.connect_failed'));
}

View File

@ -73,6 +73,14 @@ export const useAuthStore = create<AuthState>((set) => ({
signOut: async () => {
await supabase.auth.signOut();
// Google-OAuth-Cookie in SafariViewController/Chrome Custom Tabs leeren,
// sonst springt der nächste Sign-in stillschweigend auf den vorigen Account
// statt den Account-Picker zu zeigen.
try {
await WebBrowser.coolDownAsync();
} catch {
// ignore
}
set({ session: null, user: null });
},
@ -91,6 +99,9 @@ export const useAuthStore = create<AuthState>((set) => ({
options: {
redirectTo: redirectUri,
skipBrowserRedirect: true,
// Google: prompt=select_account erzwingt den Account-Picker,
// auch wenn der Browser noch eine aktive Google-Session hat.
...(provider === 'google' ? { queryParams: { prompt: 'select_account' } } : {}),
},
});