mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
no message
This commit is contained in:
19
TelegramUI/NavigateToChatController.swift
Normal file
19
TelegramUI/NavigateToChatController.swift
Normal file
@@ -0,0 +1,19 @@
|
||||
import Foundation
|
||||
import Display
|
||||
import TelegramCore
|
||||
import Postbox
|
||||
|
||||
func navigateToChatController(navigationController: NavigationController, account: Account, peerId: PeerId) {
|
||||
var found = false
|
||||
for controller in navigationController.viewControllers {
|
||||
if let controller = controller as? ChatController, controller.peerId == peerId {
|
||||
navigationController.popToViewController(controller, animated: true)
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
navigationController.pushViewController(ChatController(account: account, peerId: peerId))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user