mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-02 22:43:57 +01:00
fix: handle optional activeTab in tab activation logic (#2106)
This commit is contained in:
parent
27c9ea7ab6
commit
00ec678569
@ -115,7 +115,7 @@ export const useTabs: UseStore<TabsState> = create((set, get) => ({
|
||||
set({ activeTab: undefined, activeReactTab: undefined });
|
||||
}
|
||||
|
||||
if (tab.tabId === activeTab.tabId && tabIndex !== -1) {
|
||||
if (tab.tabId === activeTab?.tabId && tabIndex !== -1) {
|
||||
const tabToTheRight = updatedTabs[tabIndex];
|
||||
const lastOpenTab = updatedTabs[updatedTabs.length - 1];
|
||||
const newActiveTab = tabToTheRight ?? lastOpenTab;
|
||||
|
Loading…
x
Reference in New Issue
Block a user