diff --git a/submodules/Display/Display/Navigation/NavigationController.swift b/submodules/Display/Display/Navigation/NavigationController.swift index e8a48dc5d9..4dc05a9cd2 100644 --- a/submodules/Display/Display/Navigation/NavigationController.swift +++ b/submodules/Display/Display/Navigation/NavigationController.swift @@ -154,6 +154,13 @@ open class NavigationController: UINavigationController, ContainableController, private var _displayNode: ASDisplayNode? public var displayNode: ASDisplayNode { + if let value = self._displayNode { + return value + } + if !self.isViewLoaded { + self.loadView() + } + return self._displayNode! } diff --git a/submodules/Display/Display/WindowContent.swift b/submodules/Display/Display/WindowContent.swift index 1f654e78cc..39381f69eb 100644 --- a/submodules/Display/Display/WindowContent.swift +++ b/submodules/Display/Display/WindowContent.swift @@ -1082,12 +1082,11 @@ public class Window1 { } public func present(_ controller: ContainableController, on level: PresentationSurfaceLevel, blockInteraction: Bool = false, completion: @escaping () -> Void = {}) { - if let navigationController = self._rootController as? NavigationController, let controller = controller as? ViewController { + if level.rawValue <= 3, let navigationController = self._rootController as? NavigationController, let controller = controller as? ViewController { navigationController.presentOverlay(controller: controller, inGlobal: false) } else { - assertionFailure() + self.presentationContext.present(controller, on: level, blockInteraction: blockInteraction, completion: completion) } - //self.presentationContext.present(controller, on: level, blockInteraction: blockInteraction, completion: completion) } public func presentInGlobalOverlay(_ controller: ContainableController) {