Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored and amk-dev committed Mar 19, 2024
1 parent ee2a30c commit 2d50825
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
Expand Up @@ -131,9 +131,9 @@
"
@click="
() => {
collectionClicked({
handleCollectionClick({
collectionID: node.id,
isOpen: isOpen,
isOpen,
})
}
"
Expand Down Expand Up @@ -220,10 +220,10 @@
"
@click="
() => {
collectionClicked({
handleCollectionClick({
// for the folders, we get a path, so we need to get the last part of the path which is the folder id
collectionID: node.id.split('/').pop() as string,
isOpen: isOpen,
isOpen,
})
}
"
Expand Down Expand Up @@ -577,7 +577,7 @@ const emit = defineEmits<{
}
): void
(
event: "collection-clicked",
event: "collection-click",
payload: {
// if the collection is open or not in the tree
isOpen: boolean
Expand All @@ -596,13 +596,15 @@ const getPath = (path: string) => {
return pathArray.join("/")
}
const collectionClicked = (payload: {
const handleCollectionClick = (payload: {
collectionID: string
isOpen: boolean
}) => {
emit("collection-clicked", {
collectionID: payload.collectionID,
isOpen: payload.isOpen,
const { collectionID, isOpen } = payload
emit("collection-click", {
collectionID,
isOpen,
})
}
Expand Down
Expand Up @@ -93,7 +93,7 @@
@expand-team-collection="expandTeamCollection"
@display-modal-add="displayModalAdd(true)"
@display-modal-import-export="displayModalImportExport(true)"
@collection-clicked="handleCollectionClick"
@collection-click="handleCollectionClick"
/>
<div
class="py-15 hidden flex-1 flex-col items-center justify-center bg-primaryDark px-4 text-secondaryLight"
Expand Down Expand Up @@ -425,7 +425,7 @@ const handleCollectionClick = (payload: {
}) => {
if (
filterTexts.value.length > 0 &&
teamsSearchResults.value &&
teamsSearchResults.value.length &&
payload.isOpen
) {
expandCollection(payload.collectionID)
Expand Down
Expand Up @@ -51,11 +51,11 @@ export class TeamsSpotlightSearcherService
const scopeHandle = effectScope()

scopeHandle.run(() => {
const debouncedSearch = debounce(this.teamsSearch.searchTeams, 400)

watch(
query,
(query) => {
const debouncedSearch = debounce(this.teamsSearch.searchTeams, 400)

if (this.workspaceService.currentWorkspace.value.type === "team") {
const teamID = this.workspaceService.currentWorkspace.value.teamID
debouncedSearch(query, teamID)?.catch((_) => {})
Expand Down

0 comments on commit 2d50825

Please sign in to comment.