diff --git a/src/components/BalanceHeader.vue b/src/components/BalanceHeader.vue index d01c9e5..acb8542 100644 --- a/src/components/BalanceHeader.vue +++ b/src/components/BalanceHeader.vue @@ -10,8 +10,10 @@
-
- +
+
+ +
diff --git a/src/store.ts b/src/store.ts index 4acce56..94a03f4 100644 --- a/src/store.ts +++ b/src/store.ts @@ -131,14 +131,14 @@ export const useBalanceStore = defineStore({ user: FG.User, filter: | { - limit?: number; - offset?: number; - from?: Date; - to?: Date; - showReversals?: boolean; - showCancelled?: boolean; - descending?: boolean; - } + limit?: number; + offset?: number; + from?: Date; + to?: Date; + showReversals?: boolean; + showCancelled?: boolean; + descending?: boolean; + } | undefined = undefined ) { if (!filter) filter = { limit: 10 }; @@ -146,7 +146,13 @@ export const useBalanceStore = defineStore({ params: filter, }); data.transactions.forEach((t) => fixTransaction(t)); - if (data.transactions) this.transactions.push(...data.transactions); + if (data.transactions) { + data.transactions.forEach((t) => { + const idx = this.transactions.findIndex((x) => x.id === t.id); + if (idx == -1) this.transactions.push(t); + else this.transactions[idx] = t; + }); + } return data; },