Fixed custom setting bug

This commit is contained in:
z0ccc 2022-06-20 00:47:05 -04:00
parent b86cc7f9b1
commit 867ecc590d

View file

@ -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')