From 94ab1d5cbb9bdacb4332b1fcf386b73f7e0a5f9f Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 11 Dec 2021 20:42:13 -0700 Subject: [PATCH] Fix crash if Cordova doesn't init fast enough --- www/assets/js/main.js | 2 -- www/assets/js/platform.js | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/www/assets/js/main.js b/www/assets/js/main.js index fba4318..c79fb04 100644 --- a/www/assets/js/main.js +++ b/www/assets/js/main.js @@ -206,6 +206,4 @@ function setAnimations(enabled) { } } -loadSettings(); - router.navigate("/home"); \ No newline at end of file diff --git a/www/assets/js/platform.js b/www/assets/js/platform.js index 07cde21..0971afc 100644 --- a/www/assets/js/platform.js +++ b/www/assets/js/platform.js @@ -160,6 +160,8 @@ function initCordova() { document.addEventListener("backbutton", handleBackButton, false); document.addEventListener("deviceready", function () { + loadSettings(); + // Make sure the status bar color is set properly applyColorTheme(); @@ -239,6 +241,7 @@ function initCordova() { } function initNW() { + loadSettings(); platform_type = "nw"; platform_theme = "md"; openBrowser = function (url) { @@ -286,6 +289,7 @@ function initNW() { } function initBrowser() { + loadSettings(); platform_type = "browser"; platform_theme = "md"; openBrowser = function (url) {