fix: prevent duplicate requests from showing active indicator simultaneously (#5605)
Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
parent
4bfd1c4453
commit
b438e1d813
2 changed files with 7 additions and 2 deletions
|
|
@ -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")}`,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue