fix: minor spotlight related issues (#3271)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Anwarul Islam
2023-08-22 18:28:32 +06:00
committed by GitHub
parent 88212e8cfe
commit 3c3fb1e4a9
7 changed files with 40 additions and 21 deletions

View File

@@ -8,7 +8,7 @@ import {
ref,
watch,
} from "vue"
import { invokeAction } from "~/helpers/actions"
import { activeActions$, invokeAction } from "~/helpers/actions"
import { getI18n } from "~/modules/i18n"
import {
SpotlightSearcher,
@@ -66,6 +66,14 @@ export class WorkspaceSpotlightSearcherService extends StaticSpotlightSearcherSe
}
)[0]
private activeActions = useStreamStatic(activeActions$, [], () => {
/* noop */
})[0]
private isLoggedInUser = computed(() =>
this.activeActions.value.includes("user.logout")
)
private isTeamSelected = computed(
() =>
this.workspace.value.type === "team" &&
@@ -77,6 +85,7 @@ export class WorkspaceSpotlightSearcherService extends StaticSpotlightSearcherSe
text: this.t("spotlight.workspace.new"),
alternates: ["new", "team", "workspace"],
icon: markRaw(IconUsers),
excludeFromSearch: computed(() => !this.isLoggedInUser.value),
},
edit_team: {
text: this.t("spotlight.workspace.edit"),