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,16 +25,15 @@ import { Service } from "dioc"
import * as E from "fp-ts/Either"
import MiniSearch from "minisearch"
import IconCheckCircle from "~/components/app/spotlight/entry/IconSelected.vue"
import { useStreamStatic } from "~/composables/stream"
import { runGQLQuery } from "~/helpers/backend/GQLClient"
import { GetMyTeamsDocument, GetMyTeamsQuery } from "~/helpers/backend/graphql"
import { workspaceStatus$ } from "~/newstore/workspace"
import { platform } from "~/platform"
import IconEdit from "~icons/lucide/edit"
import IconTrash2 from "~icons/lucide/trash-2"
import IconUser from "~icons/lucide/user"
import IconUserPlus from "~icons/lucide/user-plus"
import IconUsers from "~icons/lucide/users"
import { WorkspaceService } from "~/services/workspace.service"
type Doc = {
text: string | string[]
@@ -58,14 +57,9 @@ export class WorkspaceSpotlightSearcherService extends StaticSpotlightSearcherSe
public searcherSectionTitle = this.t("spotlight.workspace.title")
private readonly spotlight = this.bind(SpotlightService)
private readonly workspaceService = this.bind(WorkspaceService)
private workspace = useStreamStatic(
workspaceStatus$,
{ type: "personal" },
() => {
/* noop */
}
)[0]
private workspace = this.workspaceService.currentWorkspace
private isTeamSelected = computed(
() =>
@@ -170,6 +164,7 @@ export class SwitchWorkspaceSpotlightSearcherService
public searcherSectionTitle = this.t("workspace.title")
private readonly spotlight = this.bind(SpotlightService)
private readonly workspaceService = this.bind(WorkspaceService)
constructor() {
super()
@@ -197,13 +192,7 @@ export class SwitchWorkspaceSpotlightSearcherService
})
}
private workspace = useStreamStatic(
workspaceStatus$,
{ type: "personal" },
() => {
/* noop */
}
)[0]
private workspace = this.workspaceService.currentWorkspace
createSearchSession(
query: Readonly<Ref<string>>