Skip to content

Commit

Permalink
fix(projects): fix homeTab closeRight and disable colseLeft
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Apr 13, 2024
1 parent eba2014 commit 53f6166
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/layouts/modules/global-tab/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ function getContextMenuDisabledKeys(tabId: string) {
const disabledKeys: App.Global.DropdownKey[] = [];
if (tabStore.isTabRetain(tabId)) {
disabledKeys.push('closeCurrent');
const homeDisable: App.Global.DropdownKey[] = ['closeCurrent', 'closeLeft'];
disabledKeys.push(...homeDisable);
}
return disabledKeys;
Expand Down
6 changes: 6 additions & 0 deletions src/store/modules/tab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => {
* @param tabId
*/
async function clearRightTabs(tabId: string) {
const isHomeTab = tabId === homeTab.value?.id;
if (isHomeTab) {
clearTabs();
return;
}

const tabIds = tabs.value.map(tab => tab.id);
const index = tabIds.indexOf(tabId);
if (index === -1) return;
Expand Down

0 comments on commit 53f6166

Please sign in to comment.