diff --git a/pwabuilder-sw.js b/pwabuilder-sw.js index 8484ed01..ea4c0221 100644 --- a/pwabuilder-sw.js +++ b/pwabuilder-sw.js @@ -4,7 +4,7 @@ // App version number - ENSURE IT MATCHES VALUE IN init.js // DEV: Changing this will cause the browser to recognize that the Service Worker has changed, and it will download and // install a new copy -const appVersion = '1.1.4-RP4'; +const appVersion = '1.1.4-RP5'; // Kiwix ZIM Archive Download Server in regex form // DEV: The server URL is defined in init.js, but is not available to us in SW diff --git a/www/js/app.js b/www/js/app.js index 90efb6aa..ce457a8f 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -926,7 +926,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett if (selectFired) return; // If nothing was selected, user will have to click again // (NB this.selectedIndex will be -1 if no value has been selected) - if (!~list.selectedIndex) return; + if (!list || !~list.selectedIndex) return; selectFired = true; var selected = list.target.value; // Void any previous picked file to prevent it launching @@ -1369,6 +1369,8 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett //Code below triggers display of modal info box if app is run for the first time, or it has been upgraded to new version if (settingsStore.getItem('version') !== params.version) { firstRun = true; + // Make user re-pick file if we have upgraded (it's less confusing than filehandle errors) + settingsStore.removeItem('listOfArchives'); // On some platforms, bootstrap's jQuery functions have not been injected yet, so we have to run in a timeout setTimeout(function () { $('#myModal').modal({ diff --git a/www/js/init.js b/www/js/init.js index 36d0fa55..0aa42746 100644 --- a/www/js/init.js +++ b/www/js/init.js @@ -49,7 +49,7 @@ var params = {}; */ var appstate = {}; /******** UPDATE VERSION IN pwabuilder-sw.js TO MATCH VERSION *******/ -params['version'] = "1.1.4-RP4"; //DEV: Manually update this version when there is a new release: it is compared to the Settings Store "version" in order to show first-time info, and the cookie is updated in app.js +params['version'] = "1.1.4-RP5"; //DEV: Manually update this version when there is a new release: it is compared to the Settings Store "version" in order to show first-time info, and the cookie is updated in app.js /******* UPDATE THIS ^^^^^^ IN serveice worker!! ********************/ params['packagedFile'] = "wikipedia_en_100_maxi.zim"; //For packaged Kiwix JS (e.g. with Wikivoyage file), set this to the filename (for split files, give the first chunk *.zimaa) and place file(s) in default storage params['archivePath'] = "archives"; //The directory containing the packaged archive(s) (relative to app's root directory) diff --git a/www/js/lib/settingsStore.js b/www/js/lib/settingsStore.js index a00ed22c..2d6ede5f 100644 --- a/www/js/lib/settingsStore.js +++ b/www/js/lib/settingsStore.js @@ -77,7 +77,7 @@ define([], function () { if (localStorageTest) { localStorage.removeItem('lastPageHTML'); localStorage.removeItem(keyPrefix + 'lastPageHTML'); - localStorage.removeItem('lastPageVisit'); + localStorage.removeItem(keyPrefix + 'lastPageVisit'); } settingsStore.removeItem('lastPageVisit'); // Note that if this function returns 'none', the cookie implementations below will run anyway. This is because storing a cookie