From 3b487ca0d9dbf4880b2a11378391007d55ac4031 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 17 Jan 2026 19:02:44 +0800 Subject: [PATCH] fix the currently displayed group is incorrect after deleting a tag group --- src/views/desktop/tags/ListPage.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/views/desktop/tags/ListPage.vue b/src/views/desktop/tags/ListPage.vue index daa33cfd..35d53bd1 100644 --- a/src/views/desktop/tags/ListPage.vue +++ b/src/views/desktop/tags/ListPage.vue @@ -511,14 +511,14 @@ function removeTagGroup(): void { }).then(() => { updating.value = false; - if (transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex]) { - const newActiveTagGroup = transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex]; - activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : ''; - } else if (transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex - 1]) { - const newActiveTagGroup = transactionTagsStore.allTransactionTagGroups[currentTagGroupIndex - 1]; - activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : ''; + if (allTagGroupsWithDefault.value[currentTagGroupIndex]) { + const newActiveTagGroup = allTagGroupsWithDefault.value[currentTagGroupIndex]; + activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : DEFAULT_TAG_GROUP_ID; + } else if (allTagGroupsWithDefault.value[currentTagGroupIndex - 1]) { + const newActiveTagGroup = allTagGroupsWithDefault.value[currentTagGroupIndex - 1]; + activeTagGroupId.value = newActiveTagGroup ? newActiveTagGroup.id : DEFAULT_TAG_GROUP_ID; } else { - activeTagGroupId.value = ''; + activeTagGroupId.value = DEFAULT_TAG_GROUP_ID; } }).catch(error => { updating.value = false;