diff --git a/Sources/SwiftUIOverlayContainer/Container/QueueHandler.swift b/Sources/SwiftUIOverlayContainer/Container/QueueHandler.swift index ebf3f21..312b7eb 100644 --- a/Sources/SwiftUIOverlayContainer/Container/QueueHandler.swift +++ b/Sources/SwiftUIOverlayContainer/Container/QueueHandler.swift @@ -156,7 +156,7 @@ extension ContainerQueueHandler { } func dismissTopmostView(animated flag: Bool) { - if let theTopView = mainQueue.first { + if let theTopView = mainQueue.last { dismiss(id: theTopView.id, animated: flag) } }