diff --git a/packages/hoppscotch-common/src/components/new-collections/rest/Request.vue b/packages/hoppscotch-common/src/components/new-collections/rest/Request.vue index 3a385d3f5..94075da54 100644 --- a/packages/hoppscotch-common/src/components/new-collections/rest/Request.vue +++ b/packages/hoppscotch-common/src/components/new-collections/rest/Request.vue @@ -79,7 +79,7 @@ interactive trigger="click" theme="popover" - :on-shown="() => tippyActions.focus()" + :on-shown="() => tippyActions?.focus()" > { const { auth, headers } = cascadingAuthHeadersHandle.value.data - const { providerID, requestID, workspaceID } = requestHandle.value.data - tabs.createNewTab({ request: newRequest, isDirty: false, saveContext: { originLocation: "workspace-user-collection", - workspaceID, - providerID, - requestID, requestHandle, }, inheritedProperties: { @@ -1160,8 +1152,6 @@ const selectRequest = async (requestIndexPath: string) => { const { auth, headers } = cascadingAuthHeadersHandle.value.data - const { providerID, requestID, workspaceID } = requestHandle.value.data - // If there is a request with this save context, switch into it const possibleTab = tabs.getTabRefWithSaveContext({ originLocation: "workspace-user-collection", @@ -1177,9 +1167,6 @@ const selectRequest = async (requestIndexPath: string) => { isDirty: false, saveContext: { originLocation: "workspace-user-collection", - workspaceID, - providerID, - requestID, requestHandle, }, inheritedProperties: { diff --git a/packages/hoppscotch-common/src/helpers/collection/collection.ts b/packages/hoppscotch-common/src/helpers/collection/collection.ts index 59be858ff..21b7035c6 100644 --- a/packages/hoppscotch-common/src/helpers/collection/collection.ts +++ b/packages/hoppscotch-common/src/helpers/collection/collection.ts @@ -123,7 +123,6 @@ export function resolveSaveContextOnCollectionReorder( requestID.split("/").slice(-1)[0] }` - tab.value.document.saveContext.requestID = newRequestID requestHandle.data = { ...requestHandle.data, collectionID: newCollectionID!, diff --git a/packages/hoppscotch-common/src/helpers/collection/request.ts b/packages/hoppscotch-common/src/helpers/collection/request.ts index 74d45299d..ba758fc2c 100644 --- a/packages/hoppscotch-common/src/helpers/collection/request.ts +++ b/packages/hoppscotch-common/src/helpers/collection/request.ts @@ -102,7 +102,6 @@ export function resolveSaveContextOnRequestReorder(payload: { requestIDArr[requestIDArr.length - 1] = requestIndex.toString() - tab.value.document.saveContext.requestID = requestIDArr.join("/") requestHandle.data.requestID = requestIDArr.join("/") requestHandle.data.collectionID = requestIDArr.slice(0, -1).join("/") } diff --git a/packages/hoppscotch-common/src/helpers/rest/document.ts b/packages/hoppscotch-common/src/helpers/rest/document.ts index a751d54d8..a4bb9805e 100644 --- a/packages/hoppscotch-common/src/helpers/rest/document.ts +++ b/packages/hoppscotch-common/src/helpers/rest/document.ts @@ -16,17 +16,17 @@ export type HoppRESTSaveContext = /** * ID of the workspace */ - workspaceID: string + workspaceID?: string /** * ID of the provider */ - providerID: string + providerID?: string /** * Path to the request in the collection tree */ - requestID: string + requestID?: string /** * Handle to the request open in the tab diff --git a/packages/hoppscotch-common/src/services/tab/tab.ts b/packages/hoppscotch-common/src/services/tab/tab.ts index f300c2661..bac0dcbfe 100644 --- a/packages/hoppscotch-common/src/services/tab/tab.ts +++ b/packages/hoppscotch-common/src/services/tab/tab.ts @@ -18,7 +18,6 @@ import { TabService as TabServiceInterface, } from "." -import { HoppGQLDocument } from "~/helpers/graphql/document" import { NewWorkspaceService } from "../new-workspace" import { HandleRef } from "../new-workspace/handle" import { WorkspaceRequest } from "../new-workspace/workspace" @@ -137,10 +136,12 @@ export abstract class TabService if (E.isRight(requestHandleResult)) { requestHandle = requestHandleResult.right + const { originLocation } = saveContext + resolvedTabDoc = { ...resolvedTabDoc, saveContext: { - ...saveContext, + originLocation, requestHandle, }, }