Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
fix: dirty tab count incorrect when closing tabs (#3359)
Nivedin5c78ae4dee88
diff --git a/packages/hoppscotch-common/src/pages/index.vue b/packages/hoppscotch-common/src/pages/index.vueindex 21d97dd85..4b83ecd67 100644--- a/packages/hoppscotch-common/src/pages/index.vue+++ b/packages/hoppscotch-common/src/pages/index.vue@@ -229,11 +229,14 @@ const removeTab = (tabID: string) => {}const closeOtherTabsAction = (tabID: string) => {+ const isTabDirty = getTabRef(tabID).value?.document.isDirtyconst dirtyTabCount = getDirtyTabsCount()+ // If current tab is dirty, so we need to subtract 1 from the dirty tab count+ const balanceDirtyTabCount = isTabDirty ? dirtyTabCount - 1 : dirtyTabCount// If there are dirty tabs, show the confirm modal- if (dirtyTabCount > 0) {+ if (balanceDirtyTabCount > 0) {confirmingCloseAllTabs.value = true- unsavedTabsCount.value = dirtyTabCount+ unsavedTabsCount.value = balanceDirtyTabCountexceptedTabID.value = tabID} else {closeOtherTabs(tabID)