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

preventing double preload of the screen (#20)

* preventing double preload of the screen
This commit is contained in:
Alexey Gulev 2018-06-04 08:48:46 +03:00 committed by Björn Ritzl
parent ffc148b4bf
commit 6fbec4ab8f

View File

@ -436,6 +436,10 @@ function M.preload(id, cb)
assert(screens[id], ("There is no screen registered with id %s"):format(tostring(id)))
local screen = screens[id]
if screen.preloaded then
if cb then cb() end
return
end
local co
co = coroutine.create(function()
screen.co = co