Wikipedia: disable 'Clean history' when the history is empty (#7637)

This commit is contained in:
hius07
2021-05-06 18:27:39 +03:00
committed by GitHub
parent 170629c921
commit c129354ca3

View File

@@ -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,