From 1856469623b5846479974ba970c94e6ca244c00f Mon Sep 17 00:00:00 2001 From: yushi Date: Fri, 27 Sep 2024 17:17:49 +0800 Subject: [PATCH 1/2] udpate wallet name change --- packages/yoroi-extension/app/stores/toplevel/WalletStore.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/yoroi-extension/app/stores/toplevel/WalletStore.js b/packages/yoroi-extension/app/stores/toplevel/WalletStore.js index 8d106ef370..03ebeb5efe 100644 --- a/packages/yoroi-extension/app/stores/toplevel/WalletStore.js +++ b/packages/yoroi-extension/app/stores/toplevel/WalletStore.js @@ -415,6 +415,7 @@ export default class WalletStore extends Store { @action onRenameSelectedWallet: (string) => void = (newName) => { this.selectedWalletName = newName; + this.wallets[this.selectedIndex].name = newName; } } From 4ff7c6c7900254233969827ca791132275cd4c7f Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Fri, 27 Sep 2024 18:02:57 +0300 Subject: [PATCH 2/2] flow fix --- packages/yoroi-extension/app/stores/toplevel/WalletStore.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/yoroi-extension/app/stores/toplevel/WalletStore.js b/packages/yoroi-extension/app/stores/toplevel/WalletStore.js index 03ebeb5efe..f389978590 100644 --- a/packages/yoroi-extension/app/stores/toplevel/WalletStore.js +++ b/packages/yoroi-extension/app/stores/toplevel/WalletStore.js @@ -156,7 +156,7 @@ export default class WalletStore extends Store { } @computed get selected(): null | WalletState { - if (typeof this.selectedIndex === 'number') { + if (this.selectedIndex != null) { return this.wallets[this.selectedIndex]; } return null; @@ -415,7 +415,9 @@ export default class WalletStore extends Store { @action onRenameSelectedWallet: (string) => void = (newName) => { this.selectedWalletName = newName; - this.wallets[this.selectedIndex].name = newName; + if (this.selectedIndex != null) { + this.wallets[this.selectedIndex].name = newName; + } } }