don't send some "activity no longer available" errors
This commit is contained in:
+5
-1
@@ -84,7 +84,11 @@ if (isIOS) {
|
|||||||
}
|
}
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
// iOS is handled by the config plugin -sfn
|
// 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}),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
import * as SystemUI from 'expo-system-ui'
|
import * as SystemUI from 'expo-system-ui'
|
||||||
import {type Theme} from '@bsky.app/alf'
|
import {type Theme} from '@bsky.app/alf'
|
||||||
|
|
||||||
|
import {logger} from '#/logger'
|
||||||
import {isAndroid} from '#/platform/detection'
|
import {isAndroid} from '#/platform/detection'
|
||||||
|
|
||||||
export function setSystemUITheme(themeType: 'theme' | 'lightbox', t: Theme) {
|
export function setSystemUITheme(themeType: 'theme' | 'lightbox', t: Theme) {
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
if (themeType === 'theme') {
|
try {
|
||||||
SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor)
|
if (themeType === 'theme') {
|
||||||
} else {
|
SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor)
|
||||||
SystemUI.setBackgroundColorAsync('black')
|
} 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})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user