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

Fix back() callback

This commit is contained in:
Björn Ritzl 2023-08-08 23:51:29 +02:00
parent 1d4e48c0de
commit e5214edb22

View File

@ -991,12 +991,12 @@ function M.back(options, data, cb)
local screen = table.remove(stack) local screen = table.remove(stack)
if screen then if screen then
log("back()", screen.id) log("back()", screen.id)
local back_cb = callbacks.track()
local top = stack[#stack] local top = stack[#stack]
-- if we go back to the same screen we need to first hide it -- if we go back to the same screen we need to first hide it
-- and wait until it is hidden before we show it again -- and wait until it is hidden before we show it again
local same_screen = top and top.id == screen.id local same_screen = top and top.id == screen.id
if same_screen or (options and options.sequential) then if same_screen or (options and options.sequential) then
local back_cb = callbacks.track()
back_out(screen, top, WAIT_FOR_TRANSITION, function() back_out(screen, top, WAIT_FOR_TRANSITION, function()
if data then if data then
top.data = data top.data = data