profiles plugin: fix menu refreshing on check

This commit is contained in:
hius07
2025-06-27 14:08:03 +03:00
committed by GitHub
parent 71fe12fc8a
commit e8bf95dddc

View File

@@ -629,10 +629,10 @@ function Profiles:genAutoExecPathChangedMenuItem(text, event, profile_name, sepa
local value = util.tableGetValue(self.autoexec, event, profile_name, condition)
return value and txt .. ": " .. value or txt
end,
no_refresh_on_check = true,
checked_func = function()
return util.tableGetValue(self.autoexec, event, profile_name, condition)
end,
on_check_updated_in_callback = true,
callback = function(touchmenu_instance)
local dialog
local buttons = {{
@@ -760,10 +760,10 @@ function Profiles:genAutoExecDocConditionalMenuItem(text, event, profile_name, s
local txt = util.tableGetValue(self.autoexec, event, profile_name, condition, prop)
return txt and title .. " " .. txt or title:sub(1, -2)
end,
no_refresh_on_check = true,
checked_func = function()
return util.tableGetValue(self.autoexec, event, profile_name, condition, prop) and true
end,
on_check_updated_in_callback = true,
callback = function(touchmenu_instance)
local dialog
local buttons = self.document == nil and {} or {{
@@ -830,10 +830,10 @@ function Profiles:genAutoExecDocConditionalMenuItem(text, event, profile_name, s
enabled_func = function()
return not util.tableGetValue(self.autoexec, event_always, profile_name)
end,
no_refresh_on_check = true,
checked_func = function()
return util.tableGetValue(self.autoexec, event, profile_name, conditions[3][2]) and true
end,
on_check_updated_in_callback = true,
callback = function(touchmenu_instance)
local condition = conditions[3][2]
local dialog
@@ -895,10 +895,10 @@ function Profiles:genAutoExecDocConditionalMenuItem(text, event, profile_name, s
enabled_func = function()
return not util.tableGetValue(self.autoexec, event_always, profile_name)
end,
no_refresh_on_check = true,
checked_func = function()
return util.tableGetValue(self.autoexec, event, profile_name, conditions[4][2]) and true
end,
on_check_updated_in_callback = true,
callback = function(touchmenu_instance)
local condition = conditions[4][2]
local collections = util.tableGetValue(self.autoexec, event, profile_name, condition)