diff --git a/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx b/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx index 921ca8429ff..7927b2dd7d8 100644 --- a/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx +++ b/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx @@ -120,38 +120,6 @@ export const InsomniaTabProvider: FC = ({ children }) => { uiEventBus.emit(UIEventType.CLOSE_TAB, organizationId, [id]); }, [navigate, organizationId, projectId, updateInsomniaTabs]); - const batchCloseTabs = useCallback((deleteIds: string[]) => { - const currentTabs = appTabsRef?.current?.[organizationId]; - if (!currentTabs) { - return; - } - - if (currentTabs.tabList.every(tab => deleteIds.includes(tab.id))) { - navigate(`/organization/${organizationId}/project/${projectId}`); - updateInsomniaTabs({ - organizationId, - tabList: [], - activeTabId: '', - }); - uiEventBus.emit(UIEventType.CLOSE_TAB, organizationId, 'all'); - return; - } - - const index = currentTabs.tabList.findIndex(tab => deleteIds.includes(tab.id)); - const newTabList = currentTabs.tabList.filter(tab => !deleteIds.includes(tab.id)); - if (deleteIds.includes(currentTabs.activeTabId || '')) { - const url = newTabList[Math.max(index - 1, 0)]?.url; - navigate(url); - } - - updateInsomniaTabs({ - organizationId, - tabList: newTabList, - activeTabId: deleteIds.includes(currentTabs.activeTabId || '') ? newTabList[Math.max(index - 1, 0)]?.id : currentTabs.activeTabId as string, - }); - uiEventBus.emit(UIEventType.CLOSE_TAB, organizationId, deleteIds); - }, [navigate, organizationId, projectId, updateInsomniaTabs]); - const batchCloseTabs = useCallback((deleteIds: string[]) => { const currentTabs = appTabsRef?.current?.[organizationId]; if (!currentTabs) {