Updates to swshop part 1

Updated URL to new krist node
Form now validates if address own provided domain
Support for third-party sync nodes
Update k.lua and w.lua

Closes #60
This commit is contained in:
xAnavrins
2022-07-18 00:07:55 -04:00
parent aa3cd6d08d
commit 2461d060e0
5 changed files with 105 additions and 43 deletions

View File

@@ -79,10 +79,12 @@ function init(jua)
jua.on("websocket_failure", function(event, url)
local id = findID(url)
if id and callbackRegistry[id].failure then
callbackRegistry[id].failure(id)
if id then
if callbackRegistry[id].failure then
callbackRegistry[id].failure(id)
end
table.remove(callbackRegistry, id)
end
table.remove(callbackRegistry, id)
end)
jua.on("websocket_message", function(event, url, data)
@@ -94,10 +96,12 @@ function init(jua)
jua.on("websocket_closed", function(event, url)
local id = findID(url)
if id and callbackRegistry[id].closed then
callbackRegistry[id].closed(id)
if id then
if callbackRegistry[id].closed then
callbackRegistry[id].closed(id)
end
table.remove(callbackRegistry, id)
end
table.remove(callbackRegistry, id)
end)
else
jua.on("socket_connect", function(event, id)
@@ -107,10 +111,12 @@ function init(jua)
end)
jua.on("socket_error", function(event, id, msg)
if id and callbackRegistry[id].failure then
callbackRegistry[id].failure(id, msg)
if id then
if callbackRegistry[id].failure then
callbackRegistry[id].failure(id, msg)
end
table.remove(callbackRegistry, id)
end
table.remove(callbackRegistry, id)
end)
jua.on("socket_message", function(event, id)
@@ -121,10 +127,12 @@ function init(jua)
end)
jua.on("socket_closed", function(event, id)
if id and callbackRegistry[id].closed then
callbackRegistry[id].closed(id)
if id then
if callbackRegistry[id].closed then
callbackRegistry[id].closed(id)
end
table.remove(callbackRegistry, id)
end
table.remove(callbackRegistry, id)
end)
end
end