Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesBochet committed Nov 15, 2024
1 parent cfe6c01 commit 1669612
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ export const RecordIndexActionMenuBar = () => {

const pinnedEntries = actionMenuEntries.filter((entry) => entry.isPinned);

if (contextStoreNumberOfSelectedRecords === 0) {
return null;
}

return (
<BottomBar
bottomBarId={getActionBarIdFromActionMenuId(actionMenuId)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,20 @@ export const RecordIndexActionMenuEffect = () => {

const isCommandMenuOpened = useRecoilValue(isCommandMenuOpenedState);

useEffect(() => {
if (contextStoreNumberOfSelectedRecords === 0) {
closeActionBar();
}
}, [contextStoreNumberOfSelectedRecords, closeActionBar]);

useEffect(() => {
if (contextStoreNumberOfSelectedRecords > 0 && !isDropdownOpen) {
// We only handle opening the ActionMenuBar here, not the Dropdown.
// The Dropdown is already managed by sync handlers for events like
// right-click to open and click outside to close.
openActionBar();
}
if (contextStoreNumberOfSelectedRecords === 0 && isDropdownOpen) {
closeActionBar();
}
}, [
contextStoreNumberOfSelectedRecords,
openActionBar,
closeActionBar,
isDropdownOpen,
]);
}, [contextStoreNumberOfSelectedRecords, openActionBar, isDropdownOpen]);

useEffect(() => {
if (isRightDrawerOpen || isCommandMenuOpened) {
Expand Down

0 comments on commit 1669612

Please sign in to comment.