mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-22 19:22:25 +01:00
Close all tabs and always load first container when initializing Fabric (#2014)
Co-authored-by: Laurent Nguyen <languye@microsoft.com>
This commit is contained in:
@@ -42,6 +42,7 @@ export interface TabsState {
|
||||
selectLeftTab: () => void;
|
||||
selectRightTab: () => void;
|
||||
closeActiveTab: () => void;
|
||||
closeAllTabs: () => void;
|
||||
persistTabsState: () => void;
|
||||
}
|
||||
|
||||
@@ -237,6 +238,9 @@ export const useTabs: UseStore<TabsState> = create((set, get) => ({
|
||||
state.closeTab(state.activeTab);
|
||||
}
|
||||
},
|
||||
closeAllTabs: () => {
|
||||
set({ openedTabs: [], openedReactTabs: [], activeTab: undefined, activeReactTab: undefined });
|
||||
},
|
||||
persistTabsState: () => {
|
||||
const state = get();
|
||||
const openTabsStates = state.openedTabs.map((tab) => tab.getPersistedState());
|
||||
|
||||
Reference in New Issue
Block a user