diff --git a/packages/hoppscotch-common/src/components/new-collections/rest/index.vue b/packages/hoppscotch-common/src/components/new-collections/rest/index.vue index a17b5bdd6..07bde3f44 100644 --- a/packages/hoppscotch-common/src/components/new-collections/rest/index.vue +++ b/packages/hoppscotch-common/src/components/new-collections/rest/index.vue @@ -711,7 +711,7 @@ const duplicateRequest = async (requestIndexPath: string) => { return } - const requestHandle = cloneDeep(requestHandleResult.right) + const requestHandle = requestHandleResult.right if (requestHandle.value.type === "invalid") { // COLLECTION_INVALIDATED | INVALID_REQUEST_HANDLE @@ -775,6 +775,18 @@ const onEditRequest = async (newRequestName: string) => { return } + const possibleActiveTab = tabs.getTabRefWithSaveContext({ + originLocation: "workspace-user-collection", + requestHandle, + }) + + if (possibleActiveTab) { + possibleActiveTab.value.document.request.name = newRequestName + nextTick(() => { + possibleActiveTab.value.document.isDirty = false + }) + } + displayModalEditRequest(false) toast.success(t("request.renamed")) }