From 9970a41f26d391ef91b5666f863923cbdce5c7b7 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sat, 19 Nov 2022 18:30:10 +0000 Subject: [PATCH] Prevent UWP app crash when switching between modes Former-commit-id: aab5582345e8115970cb0db8f8206191f4b14b1d --- www/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index 9f5af8e2..394c5eaf 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1259,7 +1259,8 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images var launchLocal = function () { settingsStore.setItem('allowInternetAccess', false, Infinity); var uriParams = '?allowInternetAccess=false&contentInjectionMode=jquery'; - uriParams += '&listOfArchives=' + encodeURIComponent(settingsStore.getItem('listOfArchives')); + // Commented line below causes crash when there are too many archives + // uriParams += '&listOfArchives=' + encodeURIComponent(settingsStore.getItem('listOfArchives')); uriParams += '&lastSelectedArchive=' + encodeURIComponent(params.storedFile); uriParams += '&lastPageVisit=' + encodeURIComponent(params.lastPageVisit); // Void the PWA_launch signal so that user will be asked again next time @@ -2299,7 +2300,8 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images // except on first launch of SW mode uriParams += params.allowInternetAccess ? '' : '&contentInjectionMode=serviceworker'; uriParams += '&manipulateImages=false&allowHTMLExtraction=false'; - uriParams += '&listOfArchives=' + encodeURIComponent(settingsStore.getItem('listOfArchives')); + // Commented line below causes crash if there are too many archives + // uriParams += '&listOfArchives=' + encodeURIComponent(settingsStore.getItem('listOfArchives')); uriParams += '&lastSelectedArchive=' + encodeURIComponent(params.storedFile); // DEV: Line below causes crash when switching to SW mode in UWP app! // uriParams += '&lastPageVisit=' + encodeURIComponent(params.lastPageVisit);