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:
parent
804d4a5861
commit
d55cbc11b2
@ -80,7 +80,7 @@ export default function HomeScreen() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, backgroundColor: colors.bg }}>
|
<View style={{ flex: 1, backgroundColor: colors.groupedBg }}>
|
||||||
<AppHeader />
|
<AppHeader />
|
||||||
|
|
||||||
<FlatList
|
<FlatList
|
||||||
|
|||||||
@ -257,8 +257,12 @@ export function MailAccountSettingsSheet({
|
|||||||
async function handleSaveTitle() {
|
async function handleSaveTitle() {
|
||||||
const ok = await saveTitle(account.id, titleDraft);
|
const ok = await saveTitle(account.id, titleDraft);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
onTitleSaved(titleDraft.trim() || null);
|
const newTitle = titleDraft.trim() || null;
|
||||||
setMode('list');
|
// 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);
|
setLocalError(null);
|
||||||
const result = await connect({ email: account.email, password: passwordDraft });
|
const result = await connect({ email: account.email, password: passwordDraft });
|
||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
setPasswordDraft('');
|
// Symmetrisch zu handleSaveTitle: Sheet zuerst dismissen, dann nach
|
||||||
setPasswordVisible(false);
|
// Animation-Complete Parent informieren — sonst Modal-Conflict-Crash.
|
||||||
onPasswordSaved();
|
handleClose();
|
||||||
setMode('list');
|
setTimeout(() => onPasswordSaved(), 350);
|
||||||
} else {
|
} else {
|
||||||
setLocalError(result.error ?? t('mail.connect_failed'));
|
setLocalError(result.error ?? t('mail.connect_failed'));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,6 +73,14 @@ export const useAuthStore = create<AuthState>((set) => ({
|
|||||||
|
|
||||||
signOut: async () => {
|
signOut: async () => {
|
||||||
await supabase.auth.signOut();
|
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 });
|
set({ session: null, user: null });
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -91,6 +99,9 @@ export const useAuthStore = create<AuthState>((set) => ({
|
|||||||
options: {
|
options: {
|
||||||
redirectTo: redirectUri,
|
redirectTo: redirectUri,
|
||||||
skipBrowserRedirect: true,
|
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' } } : {}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user