mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 09:14:27 +08:00
fix the currently displayed group is incorrect after deleting a tag group
This commit is contained in:
@@ -511,14 +511,14 @@ function removeTagGroup(): void {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
updating.value = false;
|
updating.value = false;
|
||||||
|
|
||||||
if (transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex]) {
|
if (allTagGroupsWithDefault.value[currentTagGroupIndex]) {
|
||||||
const newActiveTagGroup = transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex];
|
const newActiveTagGroup = allTagGroupsWithDefault.value[currentTagGroupIndex];
|
||||||
activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : '';
|
activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : DEFAULT_TAG_GROUP_ID;
|
||||||
} else if (transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex - 1]) {
|
} else if (allTagGroupsWithDefault.value[currentTagGroupIndex - 1]) {
|
||||||
const newActiveTagGroup = transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex - 1];
|
const newActiveTagGroup = allTagGroupsWithDefault.value[currentTagGroupIndex - 1];
|
||||||
activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : '';
|
activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : DEFAULT_TAG_GROUP_ID;
|
||||||
} else {
|
} else {
|
||||||
activeTagGroupId.value = '';
|
activeTagGroupId.value = DEFAULT_TAG_GROUP_ID;
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
updating.value = false;
|
updating.value = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user