From ebc34d70314fc4924a4b482f6a5bb17d7c01ceba Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Sun, 24 Apr 2022 20:12:41 +0000 Subject: [PATCH] Make UI work for problematic and filtered transactions --- web/src/pages/AllAccounts.vue | 15 ++++++++++++--- web/src/stores/transactions.ts | 10 ++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/web/src/pages/AllAccounts.vue b/web/src/pages/AllAccounts.vue index f7a2c74..428a288 100644 --- a/web/src/pages/AllAccounts.vue +++ b/web/src/pages/AllAccounts.vue @@ -40,21 +40,30 @@ const filters = ref({ }); watch(() => filters.value.AccountID + filters.value.PayeeID + filters.value.CategoryID, function() { + if(!hasFilters.value) + return; transactions.GetFilteredTransactions(filters.value.AccountID, filters.value.CategoryID, filters.value.PayeeID); }) + +const hasFilters = computed(() => filters.value.AccountID != null || filters.value.PayeeID != null || filters.value.CategoryID); +const transactionsList = computed(() => { + if (hasFilters.value){ + return transactions.FilteredTransactionsList; + } + return transactions.ProblematicTransactionsList; +})