From c6026fca5671b380d0f8ccab51c6bc3910c1906c Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 13 Jul 2022 17:17:05 +0300 Subject: [PATCH] [mobile] extended theme switching --- apps/common/mobile/lib/controller/Themes.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/common/mobile/lib/controller/Themes.js b/apps/common/mobile/lib/controller/Themes.js index dffe5de0a5..768fdf9bf6 100644 --- a/apps/common/mobile/lib/controller/Themes.js +++ b/apps/common/mobile/lib/controller/Themes.js @@ -26,6 +26,14 @@ class ThemesController { } this.switchDarkTheme(theme, true); + + $$(window).on('storage', e => { + if ( e.key == LocalStorage.prefix + 'ui-theme' ) { + if ( !!e.newValue ) { + this.switchDarkTheme(JSON.parse(e.newValue), true); + } + } + }); } get isCurrentDark() {