Skip to content

Open source personal finance application

fix(wallets): improve setWallets function for clarity by using a temporary variable

Ilya Komichev92bf919d60bf
diff --git a/app/components/wallets/useWalletsStore.ts b/app/components/wallets/useWalletsStore.ts
index 42fab8be..05fd95bf 100644
--- a/app/components/wallets/useWalletsStore.ts
+++ b/app/components/wallets/useWalletsStore.ts
@@ -28,8 +28,9 @@ export const useWalletsStore = defineStore('wallets', () => {
}
function setWallets(values: Wallets | null) {
- items.value = values ? normalizeWallets(values) : null
- localforage.setItem('finapp.wallets', deepUnref(items.value))
+ const wallets = values ? normalizeWallets(values) : null
+ items.value = wallets
+ localforage.setItem('finapp.wallets', deepUnref(wallets))
}
async function addWallet({ id, values }: { id: WalletId, values: WalletForm }) {