diff --git a/apps/renderer/src/components/ui/modal/stacked/modal-stack.mobile.tsx b/apps/renderer/src/components/ui/modal/stacked/modal-stack.mobile.tsx index 92edc05cfa..4045af2890 100644 --- a/apps/renderer/src/components/ui/modal/stacked/modal-stack.mobile.tsx +++ b/apps/renderer/src/components/ui/modal/stacked/modal-stack.mobile.tsx @@ -59,8 +59,9 @@ const ModalToSheet = (props: ModalProps & { index: number; id: string }) => { const ModalProps: ModalActionsInternal = useMemo( () => ({ dismiss: () => { - sheetRef.current?.dismiss() - close() + sheetRef.current?.dismiss().then(() => { + close() + }) }, getIndex: () => props.index, setClickOutSideToDismiss: (v) => { @@ -74,7 +75,7 @@ const ModalToSheet = (props: ModalProps & { index: number; id: string }) => { ) }, }), - [id, props.index, setStack], + [close, id, props.index, setStack], ) const modalContentRef = useRef(null) const ModalContextProps = useMemo( diff --git a/apps/renderer/src/components/ui/modal/stacked/overlay.tsx b/apps/renderer/src/components/ui/modal/stacked/overlay.tsx index cc93746bb0..7914d75cce 100644 --- a/apps/renderer/src/components/ui/modal/stacked/overlay.tsx +++ b/apps/renderer/src/components/ui/modal/stacked/overlay.tsx @@ -21,7 +21,7 @@ export const ModalOverlay = forwardRef( }, ref: ForwardedRef, ) => ( - + {!hidden && ( void + dismiss: () => Promise } const MODAL_STACK_Z_INDEX = 1001 export const PresentSheet = forwardRef>( @@ -48,7 +48,12 @@ export const PresentSheet = forwardRef ({ dismiss: () => { - setIsOpen(false) + return new Promise((resolve) => { + setIsOpen(false) + setTimeout(() => { + resolve() + }, 500) + }) }, })) @@ -95,7 +100,7 @@ export const PresentSheet = forwardRef contentInnerRef.current!) return ( - + {!!children && {children}}