From e003f2e3cbbdfe2f8b709c1a7f1dbbcfb5e7e5f0 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Wed, 16 Nov 2022 12:37:46 -0600
Subject: Improve reliability of modal close

---
 src/view/com/modals/Modal.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/view/com/modals/Modal.tsx')

diff --git a/src/view/com/modals/Modal.tsx b/src/view/com/modals/Modal.tsx
index 210cdc41f..3317fef08 100644
--- a/src/view/com/modals/Modal.tsx
+++ b/src/view/com/modals/Modal.tsx
@@ -21,13 +21,14 @@ export const Modal = observer(function Modal() {
   const store = useStores()
   const bottomSheetRef = useRef<BottomSheet>(null)
 
-  const onShareBottomSheetChange = (snapPoint: number) => {
+  const onBottomSheetChange = (snapPoint: number) => {
     if (snapPoint === -1) {
       store.shell.closeModal()
     }
   }
   const onClose = () => {
     bottomSheetRef.current?.close()
+    store.shell.closeModal()
   }
 
   useEffect(() => {
@@ -99,7 +100,7 @@ export const Modal = observer(function Modal() {
       backdropComponent={
         store.shell.isModalActive ? createCustomBackdrop(onClose) : undefined
       }
-      onChange={onShareBottomSheetChange}>
+      onChange={onBottomSheetChange}>
       {element}
     </BottomSheet>
   )
-- 
cgit 1.4.1

