Skip to content

Commit

Permalink
fix(android): crash on opening github
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Oct 31, 2024
1 parent a1264a4 commit a2236ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/helpers/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const currentTheme = writable('auto');
export const currentColorTheme = writable('default');
export const currentRealTheme = writable('auto');


colorTheme = getString(SETTINGS_COLOR_THEME, DEFAULT_COLOR_THEME) as ColorThemes;
DEV_LOG && console.log('theme', 'start');

Expand Down Expand Up @@ -354,8 +353,13 @@ export function start() {
Application.once(Application.launchEvent, onReady);
}

Application.android.on(Application.android.activityStartedEvent, () => {
// getRealThemeAndUpdateColors();
// we need to update the theme on every activity start
// to get dynamic colors
Application.android.on(Application.android.activityStartedEvent, (event) => {
if (useDynamicColors && event.activity['isNativeScriptActivity'] === true) {
AppUtilsAndroid.applyDynamicColors(event.activity);
getRealThemeAndUpdateColors();
}
});
} else {
// without rootController systemAppearance will be null
Expand Down

0 comments on commit a2236ce

Please sign in to comment.