From d7efeea24b380aa863e96440c523830d4c75af0a Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 11 Jan 2021 22:57:46 +0800 Subject: [PATCH] fix month does not be removed after change last transaction in month --- src/store/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index a4ae2236..85910e70 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -526,7 +526,12 @@ const stores = { transactionMonthList.items.splice(j, 1, transaction); } - calculateMonthTotalAmount(state, transactionMonthList, defaultCurrency, state.transactionsFilter.accountId, i >= state.transactions.length - 1 && state.transactionsNextTimeId > 0); + if (transactionMonthList.items.length < 1) { + state.transactions.splice(i, 1); + } else { + calculateMonthTotalAmount(state, transactionMonthList, defaultCurrency, state.transactionsFilter.accountId, i >= state.transactions.length - 1 && state.transactionsNextTimeId > 0); + } + return; } }