Fixed custom setting bug
This commit is contained in:
parent
b86cc7f9b1
commit
867ecc590d
1 changed files with 2 additions and 4 deletions
|
|
@ -18,18 +18,16 @@ const DebugSettings = ({ type, title, ip, profile, setProfile }) => {
|
|||
}
|
||||
} else if (profile === 'custom') {
|
||||
chrome.storage.sync.get([type], (result) => {
|
||||
console.log(type)
|
||||
console.log(result)
|
||||
result[type] && setValue(result[type])
|
||||
})
|
||||
} else if (profile !== 'default') {
|
||||
setValue(profiles[profile][type])
|
||||
chrome.storage.sync.set({ [type]: profiles[profile][type] })
|
||||
}
|
||||
}, [ip, profile, type])
|
||||
}, [ip, profile, type, value])
|
||||
|
||||
const changeTextValue = (e) => {
|
||||
chrome.storage.sync.set({ timezone: e.target.value })
|
||||
chrome.storage.sync.set({ [type]: e.target.value })
|
||||
setValue(e.target.value)
|
||||
chrome.storage.sync.set({ profile: 'custom' })
|
||||
setProfile('custom')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue