Skip to content

Commit

Permalink
Fix for theme detection issue #4
Browse files Browse the repository at this point in the history
[Bug]: Theme detection only detects dark mode
  • Loading branch information
MarmadileManteater committed Jun 6, 2022
1 parent f3a04d6 commit 41883dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions _scripts/cordova-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,9 @@ const archiver = require('archiver');
` + ((exportType === "cordova")?`
window.isDarkMode = "light";
if (await new Promise(function (resolve, reject) { cordova.plugins.ThemeDetection.isAvailable(resolve, reject) }) ) {
if (await new Promise(function (resolve, reject) { cordova.plugins.ThemeDetection.isDarkModeEnabled(resolve,reject) }) ) {
window.isDarkMode = isDarkMode?"dark":"light";
var isDarkMode = await new Promise(function (resolve, reject) { cordova.plugins.ThemeDetection.isDarkModeEnabled(function (result) { resolve(result.value) },reject) });
if (isDarkMode) {
window.isDarkMode = "dark";
}
}`:"") + `
` + rendererContent + `
Expand Down

0 comments on commit 41883dd

Please sign in to comment.