Fix: settings could be empty on the first install
This commit is contained in:
parent
2328cf623a
commit
dc5f3e209f
|
@ -103,7 +103,11 @@ var prefs = (() => {
|
|||
};
|
||||
|
||||
const initializing = promisify(chrome.storage.sync.get.bind(chrome.storage.sync))('settings')
|
||||
.then(result => setAll(result.settings, true));
|
||||
.then(result => {
|
||||
if (result.settings) {
|
||||
setAll(result.settings, true);
|
||||
}
|
||||
});
|
||||
|
||||
chrome.storage.onChanged.addListener((changes, area) => {
|
||||
if (area !== 'sync' || !changes.settings || !changes.settings.newValue) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user