diff options
Diffstat (limited to 'views/script/loader_global.js')
-rw-r--r-- | views/script/loader_global.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/views/script/loader_global.js b/views/script/loader_global.js index 7c89d0f..db70d3b 100644 --- a/views/script/loader_global.js +++ b/views/script/loader_global.js @@ -9,13 +9,13 @@ window.addEventListener('load', () => { window.fetch("https://kartik.hopto.org/latest.php?v=" + require('@electron/remote').getCurrentWindow().update).then((data) => { data.blob().then((a) => { a.text().then((b) => { - if (require('@electron/remote').getCurrentWindow().update == "git") { + if (require('@electron/remote').getCurrentWindow().update === "git") { document.getElementById('updates').style.backgroundColor = "lightsalmon"; document.getElementById('updates').innerText = lang.updates.git; } else { console.log(b); console.log(require('../package.json').version); - if (b == require('../package.json').version) { + if (b === require('../package.json').version) { document.getElementById('updates').style.backgroundColor = "lightgreen"; document.getElementById('updates').innerText = lang.updates.ok; } else { @@ -42,6 +42,7 @@ window.addEventListener('load', () => { console.warn(e); document.getElementById('updates').style.backgroundColor = "lightcoral"; document.getElementById('updates').innerText = lang.updates.error; + require('@electron/remote').getCurrentWindow().webContents.send("notification", {title: lang.polymer.updateError[0], message: lang.polymer.updateError[1]}); setTimeout(() => { document.getElementById('banner').style.width = "380px"; document.getElementById('banner').style.height = "auto"; @@ -61,6 +62,7 @@ window.addEventListener('load', () => { console.warn(e); document.getElementById('updates').style.backgroundColor = "lightcoral"; document.getElementById('updates').innerText = lang.updates.error; + require('@electron/remote').getCurrentWindow().webContents.send("notification", {title: lang.polymer.updateError[0], message: lang.polymer.updateError[1]}); setTimeout(() => { document.getElementById('banner').style.width = "380px"; document.getElementById('banner').style.height = "auto"; @@ -80,6 +82,7 @@ window.addEventListener('load', () => { console.warn(e); document.getElementById('updates').style.backgroundColor = "lightcoral"; document.getElementById('updates').innerText = lang.updates.error; + require('@electron/remote').getCurrentWindow().webContents.send("notification", {title: lang.polymer.updateError[0], message: lang.polymer.updateError[1]}); setTimeout(() => { document.getElementById('banner').style.width = "380px"; document.getElementById('banner').style.height = "auto"; |