Skip to content

Commit

Permalink
fix: improve activeItems computation
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rita committed Feb 25, 2025
1 parent ea7a9f9 commit c7da42e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions components/header-bar/src/command-palette/hooks/use-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ export const useNavigation = ({ itemsArray, actionsArray }) => {
} = useCommandPaletteContext()

const activeItems = useMemo(() => {
if (filter) {
return itemsArray
}

if (currentView === HOME_VIEW) {
return filter || activeSection === GRID_SECTION
? itemsArray
: actionsArray
if (activeSection === GRID_SECTION) {
return itemsArray
} else {
return actionsArray
}
} else {
return filter ? itemsArray : actionsArray.concat(itemsArray)
return actionsArray.concat(itemsArray)
}
}, [filter, itemsArray, actionsArray, currentView, activeSection])

Expand Down

0 comments on commit c7da42e

Please sign in to comment.