fix: ensure LibrarySelector dropdown refreshes on button close

Added refresh() call when closing the dropdown via button click to maintain
consistency with the ClickAwayListener behavior. This ensures the UI
updates properly regardless of how the dropdown is closed, fixing an
inconsistent refresh behavior between different closing methods.

The fix tracks the previous open state and calls refresh() only when
the dropdown was open and is being closed by the button click.
This commit is contained in:
Deluan 2025-06-26 23:51:54 -04:00
commit 6125a090ef

View file

@ -109,7 +109,12 @@ const LibrarySelector = () => {
const handleToggle = (event) => {
setAnchorEl(event.currentTarget)
const wasOpen = open
setOpen(!open)
// Refresh data when closing the dropdown
if (wasOpen) {
refresh()
}
}
const handleClose = () => {