Fix: use chromeSync for consistency

This commit is contained in:
eight04 2021-12-09 23:06:06 +08:00
parent 4084c85d85
commit 2e6465b07f

View File

@ -1,5 +1,5 @@
/* global API msg */// msg.js /* global API msg */// msg.js
/* global chromeLocal */// storage-util.js /* global chromeLocal chromeSync */// storage-util.js
/* global compareRevision */// common.js /* global compareRevision */// common.js
/* global iconMan */ /* global iconMan */
/* global prefs */ /* global prefs */
@ -88,15 +88,12 @@ const syncMan = (() => {
async setDriveOptions(driveName, options) { async setDriveOptions(driveName, options) {
const key = `secure/sync/driveOptions/${driveName}`; const key = `secure/sync/driveOptions/${driveName}`;
await browser.storage.sync.set({ await chromeSync.setValue(key, options);
[key]: options,
});
}, },
async getDriveOptions(driveName) { async getDriveOptions(driveName) {
const key = `secure/sync/driveOptions/${driveName}`; const key = `secure/sync/driveOptions/${driveName}`;
const r = await browser.storage.sync.get(key); return chromeSync.getValue(key) || {};
return r[key] || {};
}, },
async start(name, fromPref = false) { async start(name, fromPref = false) {