Invalidate archiveList on upgrade

Former-commit-id: 5eb2fee2e3b29f7f78b41f5aa8bb871ab2f181f1 [formerly 45f74b47b5da39f305c8147587d5c108226109cd [formerly 51ad52bc600cb15dfe3f9e72316b4a6752230b51]]
Former-commit-id: 60c83863203feba582fe051271f48dae574d1d4d
Former-commit-id: 0c1bed9689bcaa54fcb83d6f59c9adc4e8aa3804
This commit is contained in:
Jaifroid 2021-01-12 20:50:21 +00:00
parent e5f1919f21
commit 1a13d8dc3a
4 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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({

View File

@ -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)

View File

@ -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