mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Kobo: Warn on restart if the startup script is outdated (#6916)
* Warn on restart if the startup script has been updated, because a restart will not reload it. * Also warn right after the update if it contained a startup script update...
This commit is contained in:
@@ -259,8 +259,21 @@ dbg:guard(ReaderMenu, 'setUpdateItemTable',
|
||||
end
|
||||
end)
|
||||
|
||||
function ReaderMenu:exitOrRestart(callback)
|
||||
function ReaderMenu:exitOrRestart(callback, force)
|
||||
if self.menu_container then self:onTapCloseMenu() end
|
||||
|
||||
-- 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
|
||||
|
||||
UIManager:nextTick(function()
|
||||
self.ui:onClose()
|
||||
if callback ~= nil then
|
||||
|
||||
Reference in New Issue
Block a user