Skip to content

Commit

Permalink
Fixed containerAlreadyPresenting error handing (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
almazrafi committed Apr 22, 2024
1 parent c79c44f commit 0b9fa66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Screen/Actions/Modal/ScreenPresentAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public struct ScreenPresentAction<
) {
navigator.logInfo("Presenting \(screen) on \(type(of: container))")

guard container.presented?.isBeingDismissed != false else {
let canPresent = container.presented.map { presented in
presented.isBeingDismissed || presented.modalPresentationStyle == .overCurrentContext
} ?? true

guard canPresent else {
return completion(.containerAlreadyPresenting(container, for: self))
}

Expand Down

0 comments on commit 0b9fa66

Please sign in to comment.