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) {
|
function enableWallet (name, me) {
|
||||||
// mark all wallets as disabled except the one to enable
|
const key = getStorageKey(name, me)
|
||||||
for (const walletDef of WALLET_DEFS) {
|
const config = JSON.parse(window.localStorage.getItem(key))
|
||||||
const key = getStorageKey(walletDef.name, me)
|
if (!config) return
|
||||||
let config = JSON.parse(window.localStorage.getItem(key))
|
config.enabled = true
|
||||||
const toEnable = walletDef.name === name
|
window.localStorage.setItem(key, JSON.stringify(config))
|
||||||
if (config || toEnable) {
|
|
||||||
config = { ...config, enabled: toEnable }
|
|
||||||
window.localStorage.setItem(key, JSON.stringify(config))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableWallet (name, me) {
|
function disableWallet (name, me) {
|
||||||
|
|
Loading…
Reference in New Issue