fix crash (#8348)
This commit is contained in:
@@ -145,7 +145,7 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
|
|||||||
|
|
||||||
func updateLayout() {
|
func updateLayout() {
|
||||||
// Allow updates either when identifiers match OR when prevLayoutDetentIdentifier is nil (first real content update)
|
// 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 {
|
let contentHeight = self.innerView?.subviews.first?.frame.size.height {
|
||||||
self.sheetVc?.updateDetents(contentHeight: self.clampHeight(contentHeight),
|
self.sheetVc?.updateDetents(contentHeight: self.clampHeight(contentHeight),
|
||||||
preventExpansion: self.preventExpansion)
|
preventExpansion: self.preventExpansion)
|
||||||
@@ -155,9 +155,15 @@ class SheetView: ExpoView, UISheetPresentationControllerDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func dismiss() {
|
func dismiss() {
|
||||||
|
guard let sheetVc = self.sheetVc else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
self.isClosing = true
|
self.isClosing = true
|
||||||
self.sheetVc?.dismiss(animated: true) { [weak self] in
|
DispatchQueue.main.async {
|
||||||
self?.destroy()
|
sheetVc.dismiss(animated: true) { [weak self] in
|
||||||
|
self?.destroy()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user