Wrap await calls in try/catch (#4418)
* Wrap await calls in try/catch * Fix spacing
This commit is contained in:
parent
3c03b0c13b
commit
67978382e2
2 changed files with 15 additions and 3 deletions
|
|
@ -170,7 +170,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('/');
|
||||
|
|
|
|||
|
|
@ -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});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue