diff --git a/app/actions/remote/post.ts b/app/actions/remote/post.ts index 6bb6d7971b..ba85a9240b 100644 --- a/app/actions/remote/post.ts +++ b/app/actions/remote/post.ts @@ -544,9 +544,15 @@ export const fetchPostAuthors = async (serverUrl: string, posts: Post[], fetchOn } if (promises.length) { - const result = await Promise.all(promises); - const authors = result.flat(); + const authorsResult = await Promise.allSettled(promises); + const result = authorsResult.reduce((acc, item) => { + if (item.status === 'fulfilled') { + acc.push(item.value); + } + return acc; + }, []); + const authors = result.flat(); if (!fetchOnly && authors.length) { await operator.handleUsers({ users: authors, diff --git a/app/managers/session_manager.ts b/app/managers/session_manager.ts index 2b3627173c..149a40c9c4 100644 --- a/app/managers/session_manager.ts +++ b/app/managers/session_manager.ts @@ -78,8 +78,9 @@ class SessionManager { }; private clearCookiesForServer = async (serverUrl: string) => { - this.clearCookies(serverUrl, false); if (Platform.OS === 'ios') { + this.clearCookies(serverUrl, false); + // Also delete any cookies that were set by react-native-webview this.clearCookies(serverUrl, true); } else if (Platform.OS === 'android') { diff --git a/app/screens/navigation.ts b/app/screens/navigation.ts index bfeaa7ffc2..e3698876dc 100644 --- a/app/screens/navigation.ts +++ b/app/screens/navigation.ts @@ -475,12 +475,17 @@ export function goToScreen(name: string, title: string, passProps = {}, options }); } -export function popTopScreen(screenId?: string) { - if (screenId) { - Navigation.pop(screenId); - } else { - const componentId = NavigationStore.getVisibleScreen(); - Navigation.pop(componentId); +export async function popTopScreen(screenId?: string) { + try { + if (screenId) { + await Navigation.pop(screenId); + } else { + const componentId = NavigationStore.getVisibleScreen(); + await Navigation.pop(componentId); + } + } catch (error) { + // RNN returns a promise rejection if there are no screens + // atop the root screen to pop. We'll do nothing in this case. } }