chore: correctly close modals and show toast after creating note from shared text
This commit is contained in:
@@ -6,6 +6,7 @@ import MobileModalAction from '../Modal/MobileModalAction'
|
||||
import { useModalAnimation } from '../Modal/useModalAnimation'
|
||||
import MobileModalHeader from '../Modal/MobileModalHeader'
|
||||
import { mergeRefs } from '@/Hooks/mergeRefs'
|
||||
import { DialogWithClose } from '@/Utils/CloseOpenModalsAndPopovers'
|
||||
|
||||
const DisableScroll = () => {
|
||||
useDisableBodyScrollOnMobile()
|
||||
@@ -13,8 +14,6 @@ const DisableScroll = () => {
|
||||
return null
|
||||
}
|
||||
|
||||
type PopoverWithClose = HTMLDivElement & { close: () => void }
|
||||
|
||||
const MobilePopoverContent = ({
|
||||
open,
|
||||
requestClose,
|
||||
@@ -35,7 +34,7 @@ const MobilePopoverContent = ({
|
||||
const addCloseMethod = useCallback(
|
||||
(element: HTMLDivElement | null) => {
|
||||
if (element) {
|
||||
;(element as PopoverWithClose).close = requestClose
|
||||
;(element as DialogWithClose).close = requestClose
|
||||
}
|
||||
},
|
||||
[requestClose],
|
||||
|
||||
Reference in New Issue
Block a user