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') {
|
} else if (profile === 'custom') {
|
||||||
chrome.storage.sync.get([type], (result) => {
|
chrome.storage.sync.get([type], (result) => {
|
||||||
console.log(type)
|
|
||||||
console.log(result)
|
|
||||||
result[type] && setValue(result[type])
|
result[type] && setValue(result[type])
|
||||||
})
|
})
|
||||||
} else if (profile !== 'default') {
|
} else if (profile !== 'default') {
|
||||||
setValue(profiles[profile][type])
|
setValue(profiles[profile][type])
|
||||||
chrome.storage.sync.set({ [type]: profiles[profile][type] })
|
chrome.storage.sync.set({ [type]: profiles[profile][type] })
|
||||||
}
|
}
|
||||||
}, [ip, profile, type])
|
}, [ip, profile, type, value])
|
||||||
|
|
||||||
const changeTextValue = (e) => {
|
const changeTextValue = (e) => {
|
||||||
chrome.storage.sync.set({ timezone: e.target.value })
|
chrome.storage.sync.set({ [type]: e.target.value })
|
||||||
setValue(e.target.value)
|
setValue(e.target.value)
|
||||||
chrome.storage.sync.set({ profile: 'custom' })
|
chrome.storage.sync.set({ profile: 'custom' })
|
||||||
setProfile('custom')
|
setProfile('custom')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue