File tree Expand file tree Collapse file tree 3 files changed +11
-16
lines changed
Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,11 @@ export function getSystemConfiguration() {
5353 } ) ;
5454}
5555
56-
5756export function isDeviceDarkTheme ( ) {
5857 return new Promise ( ( resolve , reject ) => {
59- if ( window . cordova && typeof cordova . exec !== ' function' ) {
60- resolve ( true )
61- return
58+ if ( window . cordova && typeof cordova . exec !== " function" ) {
59+ resolve ( true ) ;
60+ return ;
6261 }
6362 cordova . exec (
6463 ( result ) => {
@@ -68,9 +67,9 @@ export function isDeviceDarkTheme() {
6867 console . warn ( error ) ;
6968 resolve ( true ) ;
7069 } ,
71- ' System' ,
72- ' getTheme' ,
73- [ ]
70+ " System" ,
71+ " getTheme" ,
72+ [ ] ,
7473 ) ;
7574 } ) ;
76- }
75+ }
Original file line number Diff line number Diff line change 11import "./style.scss" ;
22import palette from "components/palette" ;
33import appSettings from "lib/settings" ;
4+ import { isDeviceDarkTheme } from "lib/systemConfiguration" ;
45import themes from "theme/list" ;
56import { updateSystemTheme } from "theme/preInstalled" ;
6- import { isDeviceDarkTheme } from "lib/systemConfiguration" ;
77
88export default function changeTheme ( type = "editor" ) {
99 palette (
@@ -58,18 +58,14 @@ function generateHints(type) {
5858 } ) ;
5959}
6060
61-
62-
63-
64-
6561let previousDark = await isDeviceDarkTheme ( ) ;
6662const updateTimeMs = 3000 ;
6763
6864let intervalId = setInterval ( async ( ) => {
6965 if ( appSettings . value . appTheme . toLowerCase ( ) === "system" ) {
7066 const isDark = await isDeviceDarkTheme ( ) ;
7167 if ( isDark !== previousDark ) {
72- previousDark = isDark
68+ previousDark = isDark ;
7369 updateSystemTheme ( isDark ) ;
7470 }
7571 }
@@ -87,7 +83,7 @@ function onselect(value) {
8783 if ( appSettings . value . appTheme . toLowerCase ( ) === "system" ) {
8884 const isDark = await isDeviceDarkTheme ( ) ;
8985 if ( isDark !== previousDark ) {
90- previousDark = isDark
86+ previousDark = isDark ;
9187 updateSystemTheme ( isDark ) ;
9288 }
9389 }
Original file line number Diff line number Diff line change 11import appSettings from "lib/settings" ;
2+ import { isDeviceDarkTheme } from "lib/systemConfiguration" ;
23import { createBuiltInTheme } from "./builder" ;
34import { apply } from "./list" ;
4- import { isDeviceDarkTheme } from "lib/systemConfiguration" ;
55
66const WHITE = "rgb(255, 255, 255)" ;
77const BLACK = "rgb(0, 0, 0)" ;
You can’t perform that action at this time.
0 commit comments