Improved error handling.

This commit is contained in:
Martin Edenhofer 2018-01-31 10:25:31 +01:00
parent 93b527ad85
commit 3ad13472d8
2 changed files with 23 additions and 12 deletions

View file

@ -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(

View file

@ -13,6 +13,7 @@ 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)
if chat_session
chat_session.add_recipient(@client_id, true) chat_session.add_recipient(@client_id, true)
# sent url update to agent # sent url update to agent
@ -27,6 +28,7 @@ class Sessions::Event::ChatStatusCustomer < Sessions::Event::ChatBase
chat_session.send_to_recipients(message, @client_id) chat_session.send_to_recipients(message, @client_id)
end end
end end
end
{ {
event: 'chat_status_customer', event: 'chat_status_customer',