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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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