chore: spotlight improvements for team requests search (#3930)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
Akash K
2024-03-25 12:41:18 +05:30
committed by GitHub
parent 2c5b0dcd1b
commit 6fd30f9aca
2 changed files with 29 additions and 1 deletions

View File

@@ -169,7 +169,16 @@ export class CollectionsSpotlightSearcherService
}
scopeHandle.run(() => {
const isPersonalWorkspace = computed(
() => this.workspaceService.currentWorkspace.value.type === "personal"
)
watch(query, (query) => {
if (!isPersonalWorkspace.value) {
results.value = []
return
}
if (pageCategory === "other") {
results.value = []
return

View File

@@ -58,13 +58,32 @@ export class TeamsSpotlightSearcherService
(query) => {
if (this.workspaceService.currentWorkspace.value.type === "team") {
const teamID = this.workspaceService.currentWorkspace.value.teamID
debouncedSearch(query, teamID)?.catch((_) => {})
debouncedSearch(query, teamID)?.catch(() => {})
}
},
{
immediate: true,
}
)
// set the search section title based on the current workspace
const teamName = computed(() => {
return (
(this.workspaceService.currentWorkspace.value.type === "team" &&
this.workspaceService.currentWorkspace.value.teamName) ||
this.t("team.search_title")
)
})
watch(
teamName,
(newTeamName) => {
this.searcherSectionTitle = newTeamName
},
{
immediate: true,
}
)
})
const onSessionEnd = () => {