diff --git a/www/js/app.js b/www/js/app.js index 19335050..a9bccb58 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -2397,6 +2397,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki console.time("Time to First Paint"); //return; + // App appears to have successfully launched + params.appIsLaunching = 'false'; + // Calculate the current article's ZIM baseUrl to use when processing relative links var baseUrl = dirEntry.namespace + '/' + dirEntry.url.replace(/[^/]+$/, ''); @@ -3215,6 +3218,9 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki } }).fail(function () { console.error("Error reading article with title " + title); + if (params.appIsLaunching) goToMainArticle(); + // Line below prevents bootloop + params.appIsLaunching = false; }); } diff --git a/www/js/init.js b/www/js/init.js index 1074bb92..b8412953 100644 --- a/www/js/init.js +++ b/www/js/init.js @@ -77,6 +77,7 @@ params['themeChanged'] = params['themeChanged'] || false; params['allowInternetAccess'] = params['allowInternetAccess'] || false; //Do not get value from cookie, should be explicitly set by user on a per-session basis params['printIntercept'] = false; params['printInterception'] = false; +params['appIsLaunching'] = true; //Allows some routines to tell if the app has just been launched //Prevent app boot loop with problematic pages that cause an app crash if (getCookie('lastPageLoad') == 'failed') {