From 3b0f6454a3458ca90a3060fe86fcf773812b6ace Mon Sep 17 00:00:00 2001 From: MaysWind Date: Fri, 15 Jan 2021 01:19:10 +0800 Subject: [PATCH] fix amount would also display "+" sign when amount is hidden --- src/views/mobile/Home.vue | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/views/mobile/Home.vue b/src/views/mobile/Home.vue index afcdf97f..01cf0643 100644 --- a/src/views/mobile/Home.vue +++ b/src/views/mobile/Home.vue @@ -20,7 +20,7 @@

0.00 USD - {{ thisMonthAmount.expenseAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(thisMonthAmount.incompleteExpenseAmount) }} + {{ thisMonthAmount.expenseAmount | currency(defaultCurrency) | amount(thisMonthAmount.incompleteExpenseAmount, showAmountInHomePage) }} @@ -29,7 +29,7 @@ Income of this month 0.00 USD {{ $t('Income of this month') }} - {{ thisMonthAmount.incomeAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(thisMonthAmount.incompleteIncomeAmount) }} + {{ thisMonthAmount.incomeAmount | currency(defaultCurrency) | amount(thisMonthAmount.incompleteIncomeAmount, showAmountInHomePage) }}

@@ -53,11 +53,11 @@
0.00 USD - {{ transactionOverview.today.incomeAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.today.incompleteIncomeAmount) }} + {{ transactionOverview.today.incomeAmount | currency(defaultCurrency) | amount(transactionOverview.today.incompleteIncomeAmount, showAmountInHomePage) }}
0.00 USD - {{ transactionOverview.today.expenseAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.today.incompleteExpenseAmount) }} + {{ transactionOverview.today.expenseAmount | currency(defaultCurrency) | amount(transactionOverview.today.incompleteExpenseAmount, showAmountInHomePage) }}
@@ -80,11 +80,11 @@
0.00 USD - {{ transactionOverview.thisWeek.incomeAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.thisWeek.incompleteIncomeAmount) }} + {{ transactionOverview.thisWeek.incomeAmount | currency(defaultCurrency) | amount(transactionOverview.thisWeek.incompleteIncomeAmount, showAmountInHomePage) }}
0.00 USD - {{ transactionOverview.thisWeek.expenseAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.thisWeek.incompleteExpenseAmount) }} + {{ transactionOverview.thisWeek.expenseAmount | currency(defaultCurrency) | amount(transactionOverview.thisWeek.incompleteExpenseAmount, showAmountInHomePage) }}
@@ -107,11 +107,11 @@
0.00 USD - {{ transactionOverview.thisMonth.incomeAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.thisMonth.incompleteIncomeAmount) }} + {{ transactionOverview.thisMonth.incomeAmount | currency(defaultCurrency) | amount(transactionOverview.thisMonth.incompleteIncomeAmount, showAmountInHomePage) }}
0.00 USD - {{ transactionOverview.thisMonth.expenseAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.thisMonth.incompleteExpenseAmount) }} + {{ transactionOverview.thisMonth.expenseAmount | currency(defaultCurrency) | amount(transactionOverview.thisMonth.incompleteExpenseAmount, showAmountInHomePage) }}
@@ -131,11 +131,11 @@
0.00 USD - {{ transactionOverview.thisYear.incomeAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.thisYear.incompleteIncomeAmount) }} + {{ transactionOverview.thisYear.incomeAmount | currency(defaultCurrency) | amount(transactionOverview.thisYear.incompleteIncomeAmount, showAmountInHomePage) }}
0.00 USD - {{ transactionOverview.thisYear.expenseAmount | amount(showAmountInHomePage) | currency(defaultCurrency) | completeAmount(transactionOverview.thisYear.incompleteExpenseAmount) }} + {{ transactionOverview.thisYear.expenseAmount | currency(defaultCurrency) | amount(transactionOverview.thisYear.incompleteExpenseAmount, showAmountInHomePage) }}
@@ -281,14 +281,11 @@ export default { } }, filters: { - amount(amount, showAmount) { + amount(amount, incomplete, showAmount) { if (!showAmount) { return '***'; } - return amount; - }, - completeAmount(amount, incomplete) { return amount + (incomplete ? '+' : ''); }, monthNameLocalizedKey(monthName) {