Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: prevent duplicate requests from showing active indicator simultaneously (#5605)

Chhavi Goyalb438e1d81310
diff --git a/packages/hoppscotch-common/src/components/collections/index.vue b/packages/hoppscotch-common/src/components/collections/index.vue
index f8f0aa27f..89642092a 100644
--- a/packages/hoppscotch-common/src/components/collections/index.vue
+++ b/packages/hoppscotch-common/src/components/collections/index.vue
@@ -231,6 +231,7 @@
import { useI18n } from "@composables/i18n"
import { useToast } from "@composables/toast"
import {
+ generateUniqueRefId,
getDefaultRESTRequest,
HoppCollection,
HoppRESTAuth,
@@ -1477,6 +1478,7 @@ const duplicateRequest = async (payload: {
const newRequest = {
...cloneDeep(request),
+ _ref_id: generateUniqueRefId("req"),
name: `${request.name} - ${t("action.duplicate")}`,
}
diff --git a/packages/hoppscotch-common/src/pages/index.vue b/packages/hoppscotch-common/src/pages/index.vue
index a330156f9..0c067810d 100644
--- a/packages/hoppscotch-common/src/pages/index.vue
+++ b/packages/hoppscotch-common/src/pages/index.vue
@@ -134,7 +134,7 @@
<script lang="ts" setup>
import { ref, onMounted, computed } from "vue"
-import { safelyExtractRESTRequest } from "@hoppscotch/data"
+import { generateUniqueRefId, safelyExtractRESTRequest } from "@hoppscotch/data"
import { translateExtURLParams } from "~/helpers/RESTExtURLParams"
import { useRoute } from "vue-router"
import { useI18n } from "@composables/i18n"
@@ -280,7 +280,10 @@ const duplicateTab = (tabID: string) => {
if (tab.value && tab.value.document.type === "request") {
const newTab = tabs.createNewTab({
type: "request",
- request: cloneDeep(tab.value.document.request),
+ request: {
+ ...cloneDeep(tab.value.document.request),
+ _ref_id: generateUniqueRefId("req"),
+ },
isDirty: true,
})
tabs.setActiveTab(newTab.id)