Skip to content

Commit 69cf32f

Browse files
author
Ali
committed
Fix psa message reset
1 parent 3a120a5 commit 69cf32f

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎submodules/TelegramUI/Sources/ChatController.swift‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6560,19 +6560,31 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
65606560

65616561
let psaEntities: [MessageTextEntity] = generateTextEntities(psaText, enabledTypes: .url)
65626562

6563+
let messageId = item.message.id
6564+
65636565
var found = false
65646566
self.forEachController({ controller in
65656567
if let controller = controller as? TooltipScreen {
65666568
if controller.text == psaText {
65676569
found = true
65686570
controller.resetDismissTimeout()
6571+
6572+
controller.willBecomeDismissed = { [weak self] tooltipScreen in
6573+
guard let strongSelf = self else {
6574+
return
6575+
}
6576+
if strongSelf.controllerInteraction?.currentPsaMessageWithTooltip == messageId {
6577+
strongSelf.controllerInteraction?.currentPsaMessageWithTooltip = nil
6578+
strongSelf.updatePollTooltipMessageState(animated: true)
6579+
}
6580+
}
6581+
65696582
return false
65706583
}
65716584
}
65726585
return true
65736586
})
65746587
if found {
6575-
let messageId = item.message.id
65766588
self.controllerInteraction?.currentPsaMessageWithTooltip = messageId
65776589
self.updatePollTooltipMessageState(animated: !isAutomatic)
65786590

@@ -6624,7 +6636,6 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
66246636
}
66256637
})
66266638

6627-
let messageId = item.message.id
66286639
self.controllerInteraction?.currentPsaMessageWithTooltip = messageId
66296640
self.updatePollTooltipMessageState(animated: !isAutomatic)
66306641

0 commit comments

Comments
 (0)