fix(projects): fix the incorrect judgment of home by pin tab.

This commit is contained in:
Azir-11
2025-12-04 16:03:02 +08:00
committed by Soybean
parent 64226d9bb8
commit 62a43c3957
2 changed files with 3 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ const props = withDefaults(defineProps<Props>(), {
const visible = defineModel<boolean>('visible'); const visible = defineModel<boolean>('visible');
const { removeTab, clearTabs, clearLeftTabs, clearRightTabs, fixTab, unfixTab, isTabRetain } = useTabStore(); const { removeTab, clearTabs, clearLeftTabs, clearRightTabs, fixTab, unfixTab, isTabRetain, homeTab } = useTabStore();
const { SvgIconVNode } = useSvgIcon(); const { SvgIconVNode } = useSvgIcon();
type DropdownOption = { type DropdownOption = {
@@ -65,7 +65,7 @@ const options = computed(() => {
} }
]; ];
if (props.tabId !== '/home') { if (props.tabId !== homeTab?.id) {
if (isTabRetain(props.tabId)) { if (isTabRetain(props.tabId)) {
opts.push({ opts.push({
key: 'unpin', key: 'unpin',

View File

@@ -361,6 +361,7 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => {
/** All tabs */ /** All tabs */
tabs: allTabs, tabs: allTabs,
activeTabId, activeTabId,
homeTab,
initHomeTab, initHomeTab,
initTabStore, initTabStore,
addTab, addTab,