Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarespot committed Jan 3, 2025
1 parent c0d4a12 commit 9753442
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,21 @@ addEventListener(document, 'DOMContentLoaded', async () => {
async function initConfig() {
if (ENVIRONMENT === 'development') {
const res = sessionStorage.getItem('config');
if (res) {
if (isString(res)) {
const cfg = JSON.parse(res);
state.config = {
...state.config,
...cfg,
};
}
return;
}

const res = await chrome.storage.session.get(['config']);
if (res.config) {
state.config = {
...state.config,
...res.config,
};
} else {
const res = await chrome.storage.session.get(['config']);
if (isObject(res.config)) {
state.config = {
...state.config,
...res.config,
};
}
}
}

Expand Down

0 comments on commit 9753442

Please sign in to comment.