Revert "Removed not longer needed checks."
This reverts commit 76a130ac96
.
This commit is contained in:
parent
83baddb8b0
commit
47b38e1dfb
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,7 @@ class Chat < ApplicationModel
|
||||||
store :preferences
|
store :preferences
|
||||||
|
|
||||||
def customer_state(session_id = nil)
|
def customer_state(session_id = nil)
|
||||||
|
return { state: 'chat_disabled' } if !Setting.get('chat')
|
||||||
|
|
||||||
# reconnect
|
# reconnect
|
||||||
if session_id
|
if session_id
|
||||||
|
@ -62,6 +63,7 @@ class Chat < ApplicationModel
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.agent_state(user_id)
|
def self.agent_state(user_id)
|
||||||
|
return { state: 'chat_disabled' } if !Setting.get('chat')
|
||||||
assets = {}
|
assets = {}
|
||||||
Chat.where(active: true).each {|chat|
|
Chat.where(active: true).each {|chat|
|
||||||
assets = chat.assets(assets)
|
assets = chat.assets(assets)
|
||||||
|
|
Loading…
Reference in a new issue