fix: ensure tree nodes are not computed for requests
This commit is contained in:
@@ -10,7 +10,8 @@ export class WorkspaceRESTSearchCollectionTreeAdapter
|
|||||||
constructor(public data: Ref<HoppCollection[]>) {}
|
constructor(public data: Ref<HoppCollection[]>) {}
|
||||||
|
|
||||||
getChildren(
|
getChildren(
|
||||||
nodeID: string | null
|
nodeID: string | null,
|
||||||
|
nodeType?: string
|
||||||
): Ref<ChildrenResult<RESTCollectionViewItem>> {
|
): Ref<ChildrenResult<RESTCollectionViewItem>> {
|
||||||
const result = ref<ChildrenResult<RESTCollectionViewItem>>({
|
const result = ref<ChildrenResult<RESTCollectionViewItem>>({
|
||||||
status: "loading",
|
status: "loading",
|
||||||
@@ -34,7 +35,7 @@ export class WorkspaceRESTSearchCollectionTreeAdapter
|
|||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
}
|
}
|
||||||
} else {
|
} else if (nodeType === "collection") {
|
||||||
const indexPath = nodeID.split("/").map((x) => parseInt(x))
|
const indexPath = nodeID.split("/").map((x) => parseInt(x))
|
||||||
|
|
||||||
const item = navigateToFolderWithIndexPath(this.data.value, indexPath)
|
const item = navigateToFolderWithIndexPath(this.data.value, indexPath)
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ export class WorkspaceRESTCollectionTreeAdapter
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
public getChildren(
|
public getChildren(
|
||||||
nodeID: string | null
|
nodeID: string | null,
|
||||||
|
nodeType?: string
|
||||||
): Ref<ChildrenResult<RESTCollectionViewItem>> {
|
): Ref<ChildrenResult<RESTCollectionViewItem>> {
|
||||||
if (this.workspaceHandle.value.type !== "ok") {
|
if (this.workspaceHandle.value.type !== "ok") {
|
||||||
throw new Error("Cannot issue children with invalid workspace handle")
|
throw new Error("Cannot issue children with invalid workspace handle")
|
||||||
@@ -30,6 +31,10 @@ export class WorkspaceRESTCollectionTreeAdapter
|
|||||||
|
|
||||||
if (nodeID !== null) {
|
if (nodeID !== null) {
|
||||||
;(async () => {
|
;(async () => {
|
||||||
|
if (nodeType === "request") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const collectionHandleResult =
|
const collectionHandleResult =
|
||||||
await this.workspaceService.getCollectionHandle(
|
await this.workspaceService.getCollectionHandle(
|
||||||
this.workspaceHandle,
|
this.workspaceHandle,
|
||||||
|
|||||||
Reference in New Issue
Block a user