android: fix dict overrides (#6887)

- User overrides marked as false were not checked
- Actions without app were skipped.
This commit is contained in:
Martín Fernández
2020-11-18 16:43:20 +01:00
committed by GitHub
parent dba7112390
commit 4a6f8769ae
2 changed files with 6 additions and 11 deletions

View File

@@ -102,7 +102,7 @@ local Device = Generic:new{
doExternalDictLookup = function (self, text, method, callback)
external.when_back_callback = callback
local _, app, action = external:checkMethod("dict", method)
if app and action then
if action then
android.dictLookup(text, app, action)
end
end,

View File

@@ -25,16 +25,11 @@ function M:new(o)
if ok then
o[role.."s"] = user_dicts
o.is_user_list = true
else
local t = o[role.."s"]
for i, value in ipairs(t or {}) do
local app = value[4]
if o:check(app) then
value[3] = true
end
end
if t then
self[role.."s"] = t
end
for i, value in ipairs(o[role.."s"] or {}) do
local app = value[4]
if app and o:check(app) then
value[3] = true
end
end
end