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