Fixed forward panel showing up after sending forward to scheduled messages

This commit is contained in:
Ilya Laktyushin 2019-09-03 18:07:50 +03:00
parent 4c03783ca0
commit 152a2f6249
2 changed files with 7 additions and 5 deletions

View File

@ -1554,10 +1554,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
let controller = ChatScheduleTimeController(context: strongSelf.context, mode: mode, minimalTime: strongSelf.presentationInterfaceState.slowmodeState?.timeout, completion: { [weak self] scheduleTime in
if let strongSelf = self {
strongSelf.chatDisplayNode.sendCurrentMessage(scheduleTime: scheduleTime)
if !strongSelf.presentationInterfaceState.isScheduledMessages {
strongSelf.openScheduledMessages()
}
strongSelf.chatDisplayNode.sendCurrentMessage(scheduleTime: scheduleTime, completion: { [weak self] in
if let strongSelf = self, !strongSelf.presentationInterfaceState.isScheduledMessages {
strongSelf.openScheduledMessages()
}
})
}
})
strongSelf.chatDisplayNode.dismissInput()

View File

@ -2057,7 +2057,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
}
}
func sendCurrentMessage(silentPosting: Bool? = nil, scheduleTime: Int32? = nil) {
func sendCurrentMessage(silentPosting: Bool? = nil, scheduleTime: Int32? = nil, completion: @escaping () -> Void = {}) {
if let textInputPanelNode = self.inputPanelNode as? ChatTextInputPanelNode {
if textInputPanelNode.textInputNode?.isFirstResponder() ?? false {
Keyboard.applyAutocorrection()
@ -2114,6 +2114,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
textInputPanelNode.text = ""
strongSelf.requestUpdateChatInterfaceState(false, true, { $0.withUpdatedReplyMessageId(nil).withUpdatedForwardMessageIds(nil).withUpdatedComposeDisableUrlPreview(nil) })
strongSelf.ignoreUpdateHeight = false
completion()
}
})