Fix confusing UX around enabled
This commit is contained in:
parent
d7c81cfa9f
commit
2aa0c9bc99
|
@ -202,16 +202,11 @@ function getStorageKey (name, me) {
|
|||
}
|
||||
|
||||
function enableWallet (name, me) {
|
||||
// mark all wallets as disabled except the one to enable
|
||||
for (const walletDef of WALLET_DEFS) {
|
||||
const key = getStorageKey(walletDef.name, me)
|
||||
let config = JSON.parse(window.localStorage.getItem(key))
|
||||
const toEnable = walletDef.name === name
|
||||
if (config || toEnable) {
|
||||
config = { ...config, enabled: toEnable }
|
||||
window.localStorage.setItem(key, JSON.stringify(config))
|
||||
}
|
||||
}
|
||||
const key = getStorageKey(name, me)
|
||||
const config = JSON.parse(window.localStorage.getItem(key))
|
||||
if (!config) return
|
||||
config.enabled = true
|
||||
window.localStorage.setItem(key, JSON.stringify(config))
|
||||
}
|
||||
|
||||
function disableWallet (name, me) {
|
||||
|
|
Loading…
Reference in New Issue