From 4a6f8769aea473a97247a618bfc4575bf33a4c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= Date: Wed, 18 Nov 2020 16:43:20 +0100 Subject: [PATCH] android: fix dict overrides (#6887) - User overrides marked as false were not checked - Actions without app were skipped. --- frontend/device/android/device.lua | 2 +- frontend/device/thirdparty.lua | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/frontend/device/android/device.lua b/frontend/device/android/device.lua index 469fd5422..f89fc8e50 100644 --- a/frontend/device/android/device.lua +++ b/frontend/device/android/device.lua @@ -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, diff --git a/frontend/device/thirdparty.lua b/frontend/device/thirdparty.lua index 0736ed90c..65bdfc41e 100644 --- a/frontend/device/thirdparty.lua +++ b/frontend/device/thirdparty.lua @@ -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