diff options
author | Andrew Dolgov <[email protected]> | 2019-12-15 11:57:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-12-15 11:57:26 +0300 |
commit | 07f4878d59a7459472e66a2ba0c1c0413232107e (patch) | |
tree | 872efda8bd355b8c200a75fea485b859b3b5c143 /js/prefs.js | |
parent | 0d6add5d7f9475d60330f233a6b62f9bb81d01c0 (diff) |
workaround for a race condition between dojo.parse() and tt-rss loading proper day/night css on startup because of firefox async CSS loader
Diffstat (limited to 'js/prefs.js')
-rwxr-xr-x | js/prefs.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/js/prefs.js b/js/prefs.js index 747eb4105..944e49258 100755 --- a/js/prefs.js +++ b/js/prefs.js @@ -63,19 +63,21 @@ require(["dojo/_base/kernel", try { const _App = declare("fox.App", AppBase, { constructor: function() { - parser.parse(); + this.setupNightModeDetection(() => { + parser.parse(); - this.setLoadingProgress(50); + this.setLoadingProgress(50); - const clientTzOffset = new Date().getTimezoneOffset() * 60; - const params = {op: "rpc", method: "sanityCheck", clientTzOffset: clientTzOffset}; + const clientTzOffset = new Date().getTimezoneOffset() * 60; + const params = {op: "rpc", method: "sanityCheck", clientTzOffset: clientTzOffset}; - xhrPost("backend.php", params, (transport) => { - try { - this.backendSanityCallback(transport); - } catch (e) { - this.Error.report(e); - } + xhrPost("backend.php", params, (transport) => { + try { + this.backendSanityCallback(transport); + } catch (e) { + this.Error.report(e); + } + }); }); }, initSecondStage: function() { |