diff --git a/submodules/Display/Display/NativeWindowHostView.swift b/submodules/Display/Display/NativeWindowHostView.swift index 7529222a06..b408471db7 100644 --- a/submodules/Display/Display/NativeWindowHostView.swift +++ b/submodules/Display/Display/NativeWindowHostView.swift @@ -246,6 +246,10 @@ private final class WindowRootViewController: UIViewController, UIViewController self.previousPreviewingHostView = nil } } + + override public func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { + super.present(viewControllerToPresent, animated: flag, completion: completion) + } } private final class NativeWindow: UIWindow, WindowHost { diff --git a/submodules/Display/Display/ViewController.swift b/submodules/Display/Display/ViewController.swift index 454f764476..566c83a2d7 100644 --- a/submodules/Display/Display/ViewController.swift +++ b/submodules/Display/Display/ViewController.swift @@ -448,8 +448,7 @@ public enum ViewControllerNavigationPresentation { } override open func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { - super.present(viewControllerToPresent, animated: flag, completion: completion) - return + self.view.window?.rootViewController?.present(viewControllerToPresent, animated: flag, completion: completion) } override open func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {