mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
fix no error message is shown when a tag cannot be moved
This commit is contained in:
@@ -606,16 +606,9 @@ export const useTransactionTagsStore = defineStore('transactionTags', () => {
|
|||||||
|
|
||||||
function changeTagDisplayOrder({ tagId, from, to }: { tagId: string, from: number, to: number }): Promise<void> {
|
function changeTagDisplayOrder({ tagId, from, to }: { tagId: string, from: number, to: number }): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let currentTag: TransactionTag | null = null;
|
const currentTag = allTransactionTagsMap.value[tagId];
|
||||||
|
|
||||||
for (const transactionTag of allTransactionTags.value) {
|
if (!currentTag || !allTransactionTagsByGroupMap.value[currentTag.groupId] || !allTransactionTagsByGroupMap.value[currentTag.groupId]![to]) {
|
||||||
if (transactionTag.id === tagId) {
|
|
||||||
currentTag = transactionTag;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!currentTag || !allTransactionTags.value[to]) {
|
|
||||||
reject({ message: 'Unable to move tag' });
|
reject({ message: 'Unable to move tag' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user