fix: Fixed issue where editor column would close after deleting a note on bigger screens

This commit is contained in:
Aman Harwara
2023-05-12 14:54:32 +05:30
parent da0c0f1874
commit 7affc7e575

View File

@@ -36,6 +36,7 @@ import MenuItem from '../Menu/MenuItem'
import ModalOverlay from '../Modal/ModalOverlay'
import SuperExportModal from './SuperExportModal'
import { useApplication } from '../ApplicationProvider'
import { MutuallyExclusiveMediaQueryBreakpoints } from '@/Hooks/useMediaQuery'
const iconSize = MenuItemIconSize
const iconClassDanger = `text-danger mr-2 ${iconSize}`
@@ -134,7 +135,10 @@ const NotesOptions = ({
}, [application, notes])
const closeMenuAndToggleNotesList = useCallback(() => {
toggleAppPane(AppPaneId.Items)
const isMobileScreen = matchMedia(MutuallyExclusiveMediaQueryBreakpoints.sm).matches
if (isMobileScreen) {
toggleAppPane(AppPaneId.Items)
}
closeMenu()
}, [closeMenu, toggleAppPane])