mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Wikipedia: disable 'Clean history' when the history is empty (#7637)
This commit is contained in:
@@ -299,14 +299,18 @@ Where do you want them saved?]])
|
||||
},
|
||||
{
|
||||
text = _("Clean Wikipedia history"),
|
||||
enabled_func = function()
|
||||
return wikipedia_history:has("wikipedia_history")
|
||||
end,
|
||||
keep_menu_open = true,
|
||||
callback = function()
|
||||
callback = function(touchmenu_instance)
|
||||
UIManager:show(ConfirmBox:new{
|
||||
text = _("Clean Wikipedia history?"),
|
||||
ok_text = _("Clean"),
|
||||
ok_callback = function()
|
||||
-- empty data table to replace current one
|
||||
wikipedia_history:reset{}
|
||||
touchmenu_instance:updateItems()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user