| Index: lib/subscriptionInit.js |
| =================================================================== |
| --- a/lib/subscriptionInit.js |
| +++ b/lib/subscriptionInit.js |
| @@ -238,38 +238,35 @@ |
| Synchronizer.execute(subscription); |
| } |
| - if (!Prefs.suppress_first_run_page) |
| + if (firstRun || info.platform == "chromium" && |
| + updatesVersion > Prefs.last_updates_page_displayed) |
| { |
| - let page = null; |
| - if (firstRun) |
| + Prefs.set("last_updates_page_displayed", updatesVersion).catch(() => |
| { |
| - page = "firstRun.html"; |
| - } |
| - // For now we're limiting the updates page to users of |
| - // Chromium-based browsers to gage its impact |
| - else if (info.platform == "chromium" && |
| - updatesVersion > Prefs.last_updates_page_displayed) |
| + exports.dataCorrupted = true; |
| + }).then(() => |
| { |
| - page = "updates.html"; |
| - } |
| - |
| - if (page) |
| - { |
| - browser.tabs.create({url: browser.extension.getURL(page)}); |
| - |
| - // For new users and users that have already seen this updates page we |
| - // want to avoid showing it again for subsequent updates. |
| - Prefs.last_updates_page_displayed = updatesVersion; |
| - } |
| + if (!Prefs.suppress_first_run_page) |
| + { |
| + let url; |
| + if (firstRun || exports.dataCorrupted) |
| + url = "firstRun.html"; |
| + else |
| + url = "updates.html"; |
| + browser.tabs.create({url}); |
| + } |
| + }); |
| } |
| initNotifications(); |
| } |
| -Promise.all([FilterNotifier.once("load"), |
| - Prefs.untilLoaded]).then(detectFirstRun) |
| - .then(getSubscriptions) |
| - .then(finishInitialization); |
| +Promise.all([ |
| + FilterNotifier.once("load"), |
| + Prefs.untilLoaded.catch(() => { exports.dataCorrupted = true; }) |
| +]).then(detectFirstRun) |
| + .then(getSubscriptions) |
| + .then(finishInitialization); |
| /** |
| * Indicates whether the default filter subscriptions have been added |
| @@ -281,6 +278,13 @@ |
| exports.reinitialized = false; |
| /** |
| + * Indicates whether a data corruption was detcted. |
| + * |
| + * @type {boolean} |
| + */ |
| +exports.dataCorrupted = false; |
| + |
| +/** |
| * Sets a callback that is called with an array of subscriptions to be added |
| * during initialization. The callback must return an array of subscriptions |
| * that will effectively be added. |