about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorhailey <me@haileyok.com>2025-05-08 08:49:43 -0700
committerGitHub <noreply@github.com>2025-05-08 08:49:43 -0700
commita6455b3de3f9c20b61e6791bb3f6c3ea29f65663 (patch)
tree3e91f3ad44560347a148ab359fb427569bf8ea76 /modules
parenta260ecd3075fd46a92d88089423c55c7a843366d (diff)
downloadvoidsky-a6455b3de3f9c20b61e6791bb3f6c3ea29f65663.tar.zst
fix crash (#8348)
Diffstat (limited to 'modules')
-rw-r--r--modules/bottom-sheet/ios/SheetView.swift12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/bottom-sheet/ios/SheetView.swift b/modules/bottom-sheet/ios/SheetView.swift
index b6df8d7d2..710c3c866 100644
--- a/modules/bottom-sheet/ios/SheetView.swift
+++ b/modules/bottom-sheet/ios/SheetView.swift
@@ -145,7 +145,7 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
 
   func updateLayout() {
     // Allow updates either when identifiers match OR when prevLayoutDetentIdentifier is nil (first real content update)
-    if (self.prevLayoutDetentIdentifier == self.selectedDetentIdentifier || self.prevLayoutDetentIdentifier == nil),
+    if self.prevLayoutDetentIdentifier == self.selectedDetentIdentifier || self.prevLayoutDetentIdentifier == nil,
        let contentHeight = self.innerView?.subviews.first?.frame.size.height {
       self.sheetVc?.updateDetents(contentHeight: self.clampHeight(contentHeight),
                                   preventExpansion: self.preventExpansion)
@@ -155,9 +155,15 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
   }
 
   func dismiss() {
+    guard let sheetVc = self.sheetVc else {
+      return
+    }
+
     self.isClosing = true
-    self.sheetVc?.dismiss(animated: true) { [weak self] in
-      self?.destroy()
+    DispatchQueue.main.async {
+      sheetVc.dismiss(animated: true) { [weak self] in
+        self?.destroy()
+      }
     }
   }