Improved error handling.
This commit is contained in:
parent
93b527ad85
commit
3ad13472d8
2 changed files with 23 additions and 12 deletions
|
@ -775,10 +775,19 @@ class ChatWindow extends App.Controller
|
||||||
# cleanup params
|
# cleanup params
|
||||||
fqdn = App.Config.get('fqdn')
|
fqdn = App.Config.get('fqdn')
|
||||||
http_type = App.Config.get('http_type')
|
http_type = App.Config.get('http_type')
|
||||||
|
url = ''
|
||||||
|
session = @session
|
||||||
|
|
||||||
|
# in case we do not have a model, create one
|
||||||
|
if session && !session.uiUrl
|
||||||
|
session = new App.ChatSession(session)
|
||||||
|
if session && session.uiUrl
|
||||||
|
url = session.uiUrl()
|
||||||
|
|
||||||
clean_params =
|
clean_params =
|
||||||
id: id
|
id: id
|
||||||
prefilledParams:
|
prefilledParams:
|
||||||
body: "#{http_type}://#{fqdn}#{@session.uiUrl()}"
|
body: "#{http_type}://#{fqdn}/#{url}"
|
||||||
title: 'Chat'
|
title: 'Chat'
|
||||||
|
|
||||||
App.TaskManager.execute(
|
App.TaskManager.execute(
|
||||||
|
|
|
@ -13,18 +13,20 @@ class Sessions::Event::ChatStatusCustomer < Sessions::Event::ChatBase
|
||||||
|
|
||||||
# update recipients of existing sessions
|
# update recipients of existing sessions
|
||||||
chat_session = Chat::Session.find_by(session_id: session_id)
|
chat_session = Chat::Session.find_by(session_id: session_id)
|
||||||
chat_session.add_recipient(@client_id, true)
|
if chat_session
|
||||||
|
chat_session.add_recipient(@client_id, true)
|
||||||
|
|
||||||
# sent url update to agent
|
# sent url update to agent
|
||||||
if @payload['data']['url']
|
if @payload['data']['url']
|
||||||
message = {
|
message = {
|
||||||
event: 'chat_session_notice',
|
event: 'chat_session_notice',
|
||||||
data: {
|
data: {
|
||||||
session_id: chat_session.session_id,
|
session_id: chat_session.session_id,
|
||||||
message: @payload['data']['url'],
|
message: @payload['data']['url'],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
chat_session.send_to_recipients(message, @client_id)
|
chat_session.send_to_recipients(message, @client_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue