From b87e11fed5757b838d890253092f2f63e7e26f1d Mon Sep 17 00:00:00 2001 From: Kirk Lin Date: Fri, 10 May 2024 01:11:30 +0800 Subject: [PATCH] fix: resolve issue with inability to close Pinned tab. closes #26 --- apps/admin/src/store/modules/tabs.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/admin/src/store/modules/tabs.ts b/apps/admin/src/store/modules/tabs.ts index 973aef6e..66117c73 100644 --- a/apps/admin/src/store/modules/tabs.ts +++ b/apps/admin/src/store/modules/tabs.ts @@ -61,8 +61,10 @@ export const useTabsStore = defineStore({ } }, close(isPinned: boolean, tab: Tab) { - const targetTabs = isPinned ? this.pinnedTabs : this.tabs; - this.tabs = targetTabs.filter(currentTab => currentTab.fullPath !== tab.fullPath); + if (isPinned) { + this.pinnedTabs = this.pinnedTabs.filter(currentTab => currentTab.fullPath !== tab.fullPath); + } + this.tabs = this.tabs.filter(currentTab => currentTab.fullPath !== tab.fullPath); }, closeTab(tab: Tab) { this.close(false, tab);