3
0
mirror of https://github.com/britzl/monarch.git synced 2025-06-27 02:17:53 +02:00

Check if proxy is missing resources when loading/showing it

Fixes #56
This commit is contained in:
Björn Ritzl 2019-12-10 07:11:30 +01:00
parent 7b20e48424
commit bb1f34149a

View File

@ -371,6 +371,13 @@ local function preload(screen)
screen.preloading = true
if screen.proxy then
log("preload() proxy")
local missing_resources = collectionproxy.missing_resources(screen.proxy)
if #missing_resources > 0 then
local error_message = ("preload() collection proxy %s is missing resources"):format(tostring(screen.id))
log(error_message)
screen.preloading = false
return false, error_message
end
screen.wait_for = PROXY_LOADED
msg.post(screen.proxy, ASYNC_LOAD)
coroutine.yield()