diff --git a/src/desktop-main.js b/src/desktop-main.js index 3fb11456..efd2059c 100644 --- a/src/desktop-main.js +++ b/src/desktop-main.js @@ -373,7 +373,7 @@ app.use(router); app.component('VChart', VChart); app.component('PerfectScrollbar', PerfectScrollbar); app.component('VueDatePicker', VueDatePicker); -app.component('draggable', draggable); +app.component('DraggableList', draggable); app.component('PinCodeInput', PinCodeInput); diff --git a/src/stores/account.js b/src/stores/account.js index 16c477f6..fa144296 100644 --- a/src/stores/account.js +++ b/src/stores/account.js @@ -86,14 +86,14 @@ function updateAccountToAccountList(state, account) { } } -function updateAccountDisplayOrderInAccountList(state, { account, from, to, onlyUpdateGlobalList }) { +function updateAccountDisplayOrderInAccountList(state, { account, from, to, updateListOrder, updateGlobalListOrder }) { let fromAccount = null; let toAccount = null; if (state.allCategorizedAccounts[account.category]) { const accountList = state.allCategorizedAccounts[account.category].accounts; - if (!onlyUpdateGlobalList) { + if (updateListOrder) { fromAccount = accountList[from]; toAccount = accountList[to]; accountList.splice(to, 0, accountList.splice(from, 1)[0]); @@ -108,7 +108,7 @@ function updateAccountDisplayOrderInAccountList(state, { account, from, to, only } } - if (fromAccount && toAccount) { + if (updateGlobalListOrder && fromAccount && toAccount) { let globalFromIndex = -1; let globalToIndex = -1; @@ -756,7 +756,7 @@ export const useAccountsStore = defineStore('accounts', { }); }); }, - changeAccountDisplayOrder({ accountId, from, to, onlyUpdateGlobalList }) { + changeAccountDisplayOrder({ accountId, from, to, updateListOrder, updateGlobalListOrder }) { const self = this; const account = self.allAccountsMap[accountId]; @@ -777,7 +777,8 @@ export const useAccountsStore = defineStore('accounts', { account: account, from: from, to: to, - onlyUpdateGlobalList: onlyUpdateGlobalList + updateListOrder: updateListOrder, + updateGlobalListOrder: updateGlobalListOrder }); resolve(); diff --git a/src/views/desktop/AccountsPage.vue b/src/views/desktop/AccountsPage.vue index 1d2d5da9..660a1cd6 100644 --- a/src/views/desktop/AccountsPage.vue +++ b/src/views/desktop/AccountsPage.vue @@ -102,7 +102,7 @@ - - + @@ -417,7 +417,8 @@ export default { accountId: moveEvent.element.id, from: moveEvent.oldIndex, to: moveEvent.newIndex, - onlyUpdateGlobalList: true + updateListOrder: false, + updateGlobalListOrder: true }).then(() => { self.displayOrderModified = true; }).catch(error => { @@ -440,7 +441,7 @@ export default { self.loading = false; if (!error.processed) { - self.$toast(error.message || error); + self.$refs.snackbar.showError(error); } }); }, diff --git a/src/views/mobile/accounts/ListPage.vue b/src/views/mobile/accounts/ListPage.vue index 56de05db..4f0f79b1 100644 --- a/src/views/mobile/accounts/ListPage.vue +++ b/src/views/mobile/accounts/ListPage.vue @@ -338,7 +338,9 @@ export default { self.accountsStore.changeAccountDisplayOrder({ accountId: id, from: event.from - 1, // first item in the list is title, so the index need minus one - to: event.to - 1 + to: event.to - 1, + updateListOrder: true, + updateGlobalListOrder: true }).then(() => { self.displayOrderModified = true; }).catch(error => {