refactor: persist request handles under tab saveContext

Only the IDs (workspace, provider & request IDs) to restore the handle are stored under `localStorage` and the handle is restored back at runtime.
This commit is contained in:
jamesgeorge007
2024-04-22 20:16:02 +05:30
parent f6067f14aa
commit 8467417e7a
6 changed files with 155 additions and 15 deletions

View File

@@ -3,6 +3,8 @@ import { HoppRESTResponse } from "../types/HoppRESTResponse"
import { HoppTestResult } from "../types/HoppTestResult"
import { RESTOptionTabs } from "~/components/http/RequestOptions.vue"
import { HoppInheritedProperty } from "../types/HoppInheritedProperties"
import { HandleRef } from "~/services/new-workspace/handle"
import { WorkspaceRequest } from "~/services/new-workspace/workspace"
export type HoppRESTSaveContext =
| {
@@ -25,6 +27,11 @@ export type HoppRESTSaveContext =
* Path to the request in the collection tree
*/
requestID: string
/**
* Handle to the request open in the tab
*/
requestHandle?: HandleRef<WorkspaceRequest>
}
| {
/**