diff --git a/src/js/check-updates.js b/src/js/check-updates.js index 078e8c97..f45ee225 100644 --- a/src/js/check-updates.js +++ b/src/js/check-updates.js @@ -5,6 +5,10 @@ const path = window.location.pathname const swName = `${window.location}sw.js` window.isUpdateAvailable = new Promise(function (resolve, reject) { + // we should not check for updates if app runs in browser + if (window.matchMedia('(display-mode: browser)').matches) { + resolve(false); + } // lazy way of disabling service workers while developing if ('serviceWorker' in navigator) { navigator.serviceWorker @@ -32,6 +36,8 @@ window.isUpdateAvailable = new Promise(function (resolve, reject) { }) window.isUpdateAvailable.then((isAvailable) => { - $('#reload-btn').addEventListener('click', () => window.location.reload()) - $('#update-alert').classList.remove('d-none') + if(isAvailable) { + $('#reload-btn').addEventListener('click', () => window.location.reload()) + $('#update-alert').classList.remove('d-none') + } })