Skip to content

Commit

Permalink
Fixed chat history while connecting to agent
Browse files Browse the repository at this point in the history
  • Loading branch information
KartheekPa-Kore committed Nov 29, 2024
1 parent ea8f6aa commit 2fbc214
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class ChatMessagesViewController: UIViewController, BotMessagesViewDelegate, Com
self.closeAndMinimizeEvent(dic)
self.botClosed()
}else{
let alertController = UIAlertController(title: "", message: "Would you like to close the concersation or minimize.", preferredStyle:.alert)
let alertController = UIAlertController(title: "", message: "Would you like to close the conversation or minimize.", preferredStyle:.alert)

alertController.addAction(UIAlertAction(title: "Close", style: .default)
{ action -> Void in
Expand All @@ -253,11 +253,13 @@ class ChatMessagesViewController: UIViewController, BotMessagesViewDelegate, Com
if isAgentConnect{
self.botClient.sendEventToAgentChat(eventName: close_AgentChat_EventName,messageId: "")
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { (_) in
isAgentConnect = false
self.botClosed()
}
}else{
self.botClient.sendEventToAgentChat(eventName: close_Button_EventName,messageId: "")
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { (_) in
isAgentConnect = false
self.botClosed()
}
}
Expand All @@ -269,7 +271,8 @@ class ChatMessagesViewController: UIViewController, BotMessagesViewDelegate, Com
self.closeAndMinimizeEvent(dic)
self.botClient.sendEventToAgentChat(eventName: minimize_Button_EventName,messageId: "")
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { (_) in
self.botClosed()
isAgentConnect = false
self.botClosed()
}
})
self.present(alertController, animated: true, completion: nil)
Expand Down

0 comments on commit 2fbc214

Please sign in to comment.