Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/prefs.js

Issue 29760565: Issue 6599 - Detect data corruption of storage.local (Closed)
Patch Set: Created April 24, 2018, 11:02 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/subscriptionInit.js » ('j') | lib/subscriptionInit.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/prefs.js
===================================================================
--- a/lib/prefs.js
+++ b/lib/prefs.js
@@ -327,15 +327,15 @@
let prefs = Object.keys(defaults);
prefs.forEach(addPreference);
- let localLoaded = new Promise(resolve =>
+ let localLoaded = new Promise((resolve, reject) =>
{
- ext.storage.get(prefs.map(prefToKey), items =>
+ ext.storage.get(prefs.map(prefToKey)).then(items =>
{
for (let key in items)
overrides[keyToPref(key)] = items[key];
resolve();
- });
+ }, reject);
});
let managedLoaded = new Promise(resolve =>
« no previous file with comments | « no previous file | lib/subscriptionInit.js » ('j') | lib/subscriptionInit.js » ('J')

Powered by Google App Engine
This is Rietveld