move startup script check where it belongs

At reader startup, so the intended use case is correctly handled:
- an update is downloaded, and the user restarts KOReader
- the LuaJIT process returns control to the startup script which extracts the update
- the LuaJIT process is restarted, and if the startup script was changed, the user
  is asked to quit and restart KOReader from the parent launcher
This commit is contained in:
Benoit Pierre authored and Frans de Jonge committed 2026-01-06 21:26:30 +01:00
1 parent 0b53cefb9f
commit 4186cde33a
4 files changed
+37 -44

No files matched your search

@@ -402,18 +402,6 @@ function ReaderMenu:saveDocumentSettingsAsDefault()
end
function ReaderMenu:exitOrRestart(callback, force)
-- Only restart sets a callback, which suits us just fine for this check ;)
if callback and not force and not Device:isStartupScriptUpToDate() then
UIManager:show(ConfirmBox:new{
text = _("KOReader's startup script has been updated. You'll need to completely exit KOReader to finalize the update."),
ok_text = _("Restart anyway"),
ok_callback = function()
self:exitOrRestart(callback, true)
end,
})
return
end
self:onTapCloseMenu()
UIManager:nextTick(function()
self.ui:onClose()