diff --git a/src/App.native.tsx b/src/App.native.tsx index 104a7ecaec..9821aa871c 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -84,7 +84,11 @@ if (isIOS) { } if (isAndroid) { // iOS is handled by the config plugin -sfn - ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP) + ScreenOrientation.lockAsync( + ScreenOrientation.OrientationLock.PORTRAIT_UP, + ).catch(error => + logger.debug('Could not lock orientation', {safeMessage: error}), + ) } /** diff --git a/src/alf/util/systemUI.ts b/src/alf/util/systemUI.ts index 02b5363ff1..d013f0c3f9 100644 --- a/src/alf/util/systemUI.ts +++ b/src/alf/util/systemUI.ts @@ -1,14 +1,20 @@ import * as SystemUI from 'expo-system-ui' import {type Theme} from '@bsky.app/alf' +import {logger} from '#/logger' import {isAndroid} from '#/platform/detection' export function setSystemUITheme(themeType: 'theme' | 'lightbox', t: Theme) { if (isAndroid) { - if (themeType === 'theme') { - SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor) - } else { - SystemUI.setBackgroundColorAsync('black') + try { + if (themeType === 'theme') { + SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor) + } else { + SystemUI.setBackgroundColorAsync('black') + } + } catch (error) { + // Can reject with 'The current activity is no longer available' - no big deal + logger.debug('Could not set system UI theme', {safeMessage: error}) } } }