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

Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
Chhavi Goyal 2025-11-24 03:48:21 -05:00 committed by GitHub
parent 4bfd1c4453
commit b438e1d813
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -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")}`,
}

View file

@ -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)