Moved localconfig to SB object

This commit is contained in:
Official Noob
2019-12-31 19:06:33 +00:00
committed by GitHub
parent 272698f97b
commit 2917de6776

View File

@@ -13,7 +13,7 @@ function configProxy() {
}) })
}, },
get: function(obj, prop) { get: function(obj, prop) {
return localconfig[prop] return SB.localconfig[prop]
} }
}; };
return new Proxy({}, handler); return new Proxy({}, handler);
@@ -21,13 +21,13 @@ function configProxy() {
fetchConfig = _ => new Promise(function(resolve, reject) { fetchConfig = _ => new Promise(function(resolve, reject) {
chrome.storage.sync.get(null, function(items) { chrome.storage.sync.get(null, function(items) {
localconfig = items; // Data is ready SB.localconfig = items; // Data is ready
resolve(); resolve();
}); });
}); });
async function config() { async function config() {
localconfig = {}; SB.localconfig = {};
await fetchConfig(); await fetchConfig();
SB.config = configProxy(); SB.config = configProxy();
} }