Skip to content

Commit

Permalink
修复选项页更新设置时未以最新配置项更新
Browse files Browse the repository at this point in the history
  • Loading branch information
T authored and T committed Apr 22, 2023
1 parent c5f41bc commit e347cf2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/options/index.js
Expand Up @@ -39,7 +39,7 @@ let options = {
window.onload = async function () {
let data = await chrome.storage.sync.get("options");
if (data.options) {
options = data.options
let options = data.options
} else {
chrome.storage.sync.set({ options })
}
Expand All @@ -52,7 +52,10 @@ window.onload = async function () {
}
el.disabled = false

el.onchange = (e) => {
el.onchange = async (e) => {

let data = await chrome.storage.sync.get("options");
options = data.options
options[el.name] = el.type == "checkbox" ? el.checked : el.value
chrome.storage.sync.set({ options })
}
Expand Down

0 comments on commit e347cf2

Please sign in to comment.