From 10d561c9b38c591a8093225570008b11ee5693ea Mon Sep 17 00:00:00 2001 From: Ali <> Date: Sun, 27 Mar 2022 19:52:07 +0400 Subject: [PATCH] Fix context controller dismiss when there is no content --- .../ContextControllerExtractedPresentationNode.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift b/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift index 5be9caf4f7..279192ec90 100644 --- a/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift +++ b/submodules/ContextUI/Sources/ContextControllerExtractedPresentationNode.swift @@ -711,6 +711,8 @@ final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextCo } } + let completeWithActionStack = contentNode == nil + if let contentNode = contentNode { contentNode.containingNode.willUpdateIsExtractedToContextPreview?(false, transition) @@ -747,7 +749,12 @@ final class ContextControllerExtractedPresentationNode: ASDisplayNode, ContextCo timingFunction: timingFunction, duration: duration, delay: 0.0, - removeOnCompletion: false + removeOnCompletion: false, + completion: { _ in + if completeWithActionStack { + completion() + } + } ) let actionsSize = self.actionsStackNode.bounds.size