From 6efae3a3953a966026944d23c15cb85b4ad5a8ee Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Tue, 22 Aug 2023 01:02:38 +0530 Subject: [PATCH] fix: crash when closing tab (fixes HFE-146) --- packages/hoppscotch-common/src/pages/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hoppscotch-common/src/pages/index.vue b/packages/hoppscotch-common/src/pages/index.vue index 1f1798ebc..45c7aed97 100644 --- a/packages/hoppscotch-common/src/pages/index.vue +++ b/packages/hoppscotch-common/src/pages/index.vue @@ -215,13 +215,13 @@ const sortTabs = (e: { oldIndex: number; newIndex: number }) => { } const removeTab = (tabID: string) => { - const tab = getTabRef(tabID) + const tabState = getTabRef(tabID).value - if (tab.value.document.isDirty) { + if (tabState.document.isDirty) { confirmingCloseForTabID.value = tabID } else { - closeTab(tab.value.id) - inspectionService.deleteTabInspectorResult(tab.value.id) + closeTab(tabState.id) + inspectionService.deleteTabInspectorResult(tabState.id) } }