From a9814a6bceba65e0f81136d9247eb081f952d12d Mon Sep 17 00:00:00 2001 From: amk-dev Date: Fri, 15 Sep 2023 17:53:00 +0530 Subject: [PATCH] refactor: make the calculation more expressive --- packages/hoppscotch-common/src/pages/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hoppscotch-common/src/pages/index.vue b/packages/hoppscotch-common/src/pages/index.vue index 88f91a82a..4b83ecd67 100644 --- a/packages/hoppscotch-common/src/pages/index.vue +++ b/packages/hoppscotch-common/src/pages/index.vue @@ -232,7 +232,7 @@ const closeOtherTabsAction = (tabID: string) => { const isTabDirty = getTabRef(tabID).value?.document.isDirty const dirtyTabCount = getDirtyTabsCount() // If current tab is dirty, so we need to subtract 1 from the dirty tab count - const balanceDirtyTabCount = dirtyTabCount - (isTabDirty ? 1 : 0) + const balanceDirtyTabCount = isTabDirty ? dirtyTabCount - 1 : dirtyTabCount // If there are dirty tabs, show the confirm modal if (balanceDirtyTabCount > 0) { confirmingCloseAllTabs.value = true