diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 4fb40c495a..80f77c5cb1 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -633,6 +633,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } let _ = updateMessageReactionsInteractively(postbox: strongSelf.context.account.postbox, messageId: message.id, reaction: value).start() } + strongSelf.forEachController({ controller in + if let controller = controller as? TooltipScreen { + controller.dismiss() + } + return true + }) strongSelf.window?.presentInGlobalOverlay(controller) }) } @@ -1512,6 +1518,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G let controller = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .extracted(ChatMessageContextExtractedContentSource(chatNode: strongSelf.chatDisplayNode, message: message)), items: .single(actions), reactionItems: [], recognizer: nil) strongSelf.currentContextController = controller + strongSelf.forEachController({ controller in + if let controller = controller as? TooltipScreen { + controller.dismiss() + } + return true + }) strongSelf.window?.presentInGlobalOverlay(controller) }) } else { @@ -1583,6 +1595,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G let controller = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .extracted(ChatMessageContextExtractedContentSource(chatNode: strongSelf.chatDisplayNode, message: topMessage)), items: .single(actions), reactionItems: [], recognizer: nil) strongSelf.currentContextController = controller + strongSelf.forEachController({ controller in + if let controller = controller as? TooltipScreen { + controller.dismiss() + } + return true + }) strongSelf.window?.presentInGlobalOverlay(controller) }) } diff --git a/submodules/TelegramUI/Sources/ChatMessagePollBubbleContentNode.swift b/submodules/TelegramUI/Sources/ChatMessagePollBubbleContentNode.swift index 80608f4082..2079ecad12 100644 --- a/submodules/TelegramUI/Sources/ChatMessagePollBubbleContentNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessagePollBubbleContentNode.swift @@ -1498,7 +1498,7 @@ class ChatMessagePollBubbleContentNode: ChatMessageBubbleContentNode { } timerTransition.updateAlpha(node: strongSelf.solutionButtonNode, alpha: 1.0) } - strongSelf.solutionButtonNode.update(size: solutionButtonSize, theme: item.presentationData.theme.theme, incoming: item.message.flags.contains(.Incoming)) + strongSelf.solutionButtonNode.update(size: solutionButtonSize, theme: item.presentationData.theme.theme, incoming: incoming) } else if !strongSelf.solutionButtonNode.alpha.isZero { let timerTransition: ContainedViewLayoutTransition if animation.isAnimated { diff --git a/submodules/TooltipUI/Sources/TooltipScreen.swift b/submodules/TooltipUI/Sources/TooltipScreen.swift index e0c7e07b5f..2321ded3c7 100644 --- a/submodules/TooltipUI/Sources/TooltipScreen.swift +++ b/submodules/TooltipUI/Sources/TooltipScreen.swift @@ -205,7 +205,8 @@ private final class TooltipScreenNode: ViewControllerTracingNode { } self.isArrowInverted = invertArrow case .top: - backgroundFrame = CGRect(origin: CGPoint(x: sideInset, y: layout.insets(options: [.statusBar]).top + 13.0), size: CGSize(width: layout.size.width - sideInset * 2.0, height: backgroundHeight)) + let backgroundWidth = containerWidth + backgroundFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - backgroundWidth) / 2.0), y: layout.insets(options: [.statusBar]).top + 13.0), size: CGSize(width: backgroundWidth, height: backgroundHeight)) } transition.updateFrame(node: self.containerNode, frame: backgroundFrame)