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:
parent
ffc148b4bf
commit
6fbec4ab8f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user