nothing to see here

This commit is contained in:
kepler155c@gmail.com
2019-07-18 17:25:07 -06:00
parent e36f1bf364
commit b4f51df463
3 changed files with 8 additions and 6 deletions

View File

@@ -737,7 +737,7 @@ end
--[[-- startup logic --]]--
local args = {...}
if #args < 1 then
error('supply file name')
error('supply file name or URL')
end
Builder.itemAdapter = Adapter.wrap({ side = 'bottom', direction = 'up' })

View File

@@ -70,7 +70,9 @@ function setup:eventHandler(event)
if not fs.exists(STARTUP_FILE) then
Util.writeFile(STARTUP_FILE,
[[os.sleep(1)
shell.openForegroundTab('packages/milo/MiloRemote')]])
if shell.openForegroundTab then
shell.openForegroundTab('packages/milo/MiloRemote')
end]])
end
elseif fs.exists(STARTUP_FILE) then
fs.delete(STARTUP_FILE)

View File

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