Skip to content

Commit

Permalink
chore: spotlight improvements for team requests search (#3930)
Browse files Browse the repository at this point in the history
Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
  • Loading branch information
amk-dev and jamesgeorge007 committed Mar 25, 2024
1 parent 2c5b0dc commit 6fd30f9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Expand Up @@ -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
Expand Down
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 6fd30f9

Please sign in to comment.