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 694cbf192..eb37dfba3 100644 --- a/packages/hoppscotch-common/src/components/new-collections/rest/index.vue +++ b/packages/hoppscotch-common/src/components/new-collections/rest/index.vue @@ -1267,25 +1267,6 @@ const onEditRequest = async (newRequestName: string) => { return } - const { providerID, workspaceID } = requestHandle.value.data - - const possibleActiveTab = tabs.getTabRefWithSaveContext({ - originLocation: "workspace-user-collection", - workspaceID, - providerID, - requestID, - }) - - if (possibleActiveTab) { - possibleActiveTab.value.document.request = { - ...possibleActiveTab.value.document.request, - name: newRequestName, - } - nextTick(() => { - possibleActiveTab.value.document.isDirty = false - }) - } - displayModalEditRequest(false) toast.success(t("request.renamed")) } diff --git a/packages/hoppscotch-common/src/services/new-workspace/providers/personal.workspace.ts b/packages/hoppscotch-common/src/services/new-workspace/providers/personal.workspace.ts index 81541bc62..d4fc24658 100644 --- a/packages/hoppscotch-common/src/services/new-workspace/providers/personal.workspace.ts +++ b/packages/hoppscotch-common/src/services/new-workspace/providers/personal.workspace.ts @@ -449,6 +449,17 @@ export class PersonalWorkspaceProviderService workspaceType: "personal", }) + for (const [idx, handle] of this.issuedHandles.entries()) { + if (handle.value.type === "invalid") continue + + if ("requestID" in handle.value.data) { + if (handle.value.data.requestID === requestID) { + // @ts-expect-error - We're updating the request data + this.issuedHandles[idx].value.data.request = newRequest + } + } + } + return Promise.resolve(E.right(undefined)) }