Automated cherry pick of #4418 (#4419)

* Wrap await calls in try/catch

* Fix spacing

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
This commit is contained in:
Mattermost Build 2020-06-12 22:15:35 +02:00 committed by GitHub
parent b5c3e95a4b
commit 514e9cfd08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View file

@ -169,7 +169,11 @@ class GlobalEventHandler {
resetMomentLocale();
// TODO: Handle when multi-server support is added
await CookieManager.clearAll(Platform.OS === 'ios');
try {
await CookieManager.clearAll(Platform.OS === 'ios');
} catch (error) {
// Nothing to clear
}
PushNotifications.clearNotifications();
const cacheDir = RNFetchBlob.fs.dirs.CacheDir;
const mainPath = cacheDir.split('/').slice(0, -1).join('/');

View file

@ -50,7 +50,11 @@ export default class LoginOptions extends PureComponent {
const {intl} = this.context;
const screen = 'Login';
const title = intl.formatMessage({id: 'mobile.routes.login', defaultMessage: 'Login'});
await CookieManager.clearAll(Platform.OS === 'ios');
try {
await CookieManager.clearAll(Platform.OS === 'ios');
} catch (error) {
// Nothing to clear
}
goToScreen(screen, title);
});
@ -58,7 +62,11 @@ export default class LoginOptions extends PureComponent {
const {intl} = this.context;
const screen = 'SSO';
const title = intl.formatMessage({id: 'mobile.routes.sso', defaultMessage: 'Single Sign-On'});
await CookieManager.clearAll(Platform.OS === 'ios');
try {
await CookieManager.clearAll(Platform.OS === 'ios');
} catch (error) {
// Nothing to clear
}
goToScreen(screen, title, {ssoType});
};