forked from Ivasoft/mattermost-mobile
Fix some issues found by Sentry (#6962)
This commit is contained in:
@@ -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<UserProfile[][]>((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,
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user