nothing to see here
This commit is contained in:
@@ -72,14 +72,14 @@ function init(jua)
|
||||
if async then
|
||||
jua.on("websocket_success", function(event, url, handle)
|
||||
local success, id = pcall(findID,url)
|
||||
if id and callbackRegistry[id] and callbackRegistry[id].success then
|
||||
if success and id and callbackRegistry[id] and callbackRegistry[id].success then
|
||||
callbackRegistry[id].success(id, handle)
|
||||
end
|
||||
end)
|
||||
|
||||
jua.on("websocket_failure", function(event, url)
|
||||
local success, id = pcall(findID,url)
|
||||
if id and callbackRegistry[id] and callbackRegistry[id].failure then
|
||||
if success and id and callbackRegistry[id] and callbackRegistry[id].failure then
|
||||
callbackRegistry[id].failure(id)
|
||||
end
|
||||
table.remove(callbackRegistry, id)
|
||||
@@ -87,14 +87,14 @@ function init(jua)
|
||||
|
||||
jua.on("websocket_message", function(event, url, data)
|
||||
local success, id = pcall(findID,url)
|
||||
if id and callbackRegistry[id] and callbackRegistry[id].message then
|
||||
if success and id and callbackRegistry[id] and callbackRegistry[id].message then
|
||||
callbackRegistry[id].message(id, data)
|
||||
end
|
||||
end)
|
||||
|
||||
jua.on("websocket_closed", function(event, url)
|
||||
local success, id = pcall(findID,url)
|
||||
if id and callbackRegistry[id] and callbackRegistry[id].closed then
|
||||
if success and id and callbackRegistry[id] and callbackRegistry[id].closed then
|
||||
callbackRegistry[id].closed(id)
|
||||
end
|
||||
table.remove(callbackRegistry, id)
|
||||
|
||||
Reference in New Issue
Block a user