refactor: minor performance improvements on teams related operations

This commit is contained in:
Andrew Bastin
2023-09-18 18:50:57 +05:30
parent bcc1147f81
commit 185b575e5b
16 changed files with 519 additions and 202 deletions

View File

@@ -25,8 +25,7 @@ import {
HoppGQLRequest,
HoppRESTRequest,
} from "@hoppscotch/data"
import { hoppWorkspaceStore } from "~/newstore/workspace"
import { changeWorkspace } from "~/newstore/workspace"
import { WorkspaceService } from "~/services/workspace.service"
import { invokeAction } from "~/helpers/actions"
/**
@@ -46,6 +45,7 @@ export class CollectionsSpotlightSearcherService
public searcherSectionTitle = this.t("collection.my_collections")
private readonly spotlight = this.bind(SpotlightService)
private readonly workspaceService = this.bind(WorkspaceService)
constructor() {
super()
@@ -284,8 +284,8 @@ export class CollectionsSpotlightSearcherService
const folderPath = path.split("/").map((x) => parseInt(x))
const reqIndex = folderPath.pop()!
if (hoppWorkspaceStore.value.workspace.type !== "personal") {
changeWorkspace({
if (this.workspaceService.currentWorkspace.value.type !== "personal") {
this.workspaceService.changeWorkspace({
type: "personal",
})
}