From a63f6b03d49d57b8fff440b043ec7cae4e82a3e2 Mon Sep 17 00:00:00 2001 From: rugk Date: Sun, 15 Sep 2019 13:45:43 +0200 Subject: [PATCH] Fix with new ID --- src/options/modules/CustomOptionTriggers.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/options/modules/CustomOptionTriggers.js b/src/options/modules/CustomOptionTriggers.js index f550509..5579d8a 100644 --- a/src/options/modules/CustomOptionTriggers.js +++ b/src/options/modules/CustomOptionTriggers.js @@ -19,8 +19,6 @@ const CLIPBOARD_WRITE_PERMISSION = { const MESSAGE_EMOJI_COPY_PERMISSION_FALLBACK = "emojiCopyOnlyFallbackPermissionInfo"; const MESSAGE_EMOJI_COPY_PERMISSION_SEARCH = "searchActionCopyPermissionInfo"; -let lastEmojiSearchSettings = null; - /** * Adjust UI if QR code size option is changed. * @@ -305,15 +303,15 @@ function applyEmojiSearch(optionValue, option, event = {}) { enabled: isEnabled }; - if (document.getElementById("searchAction").checked) { - newOptionValue.action = document.getElementById("searchAction").value; + if (document.getElementById("searchCopyAction").checked) { + newOptionValue.action = document.getElementById("searchCopyAction").value; } else if (document.getElementById("emojipediaAction").checked) { newOptionValue.action = document.getElementById("emojipediaAction").value; } // we can only all hope, this won't end in an inifnitive loop applyEmojiSearch(newOptionValue); - } + }; // request permission from user if (optionValue.enabled && // only if actually enabled @@ -331,12 +329,9 @@ function applyEmojiSearch(optionValue, option, event = {}) { reloadEmojiSearchStatus(); }); } else { - // debugger; PermissionRequest.cancelPermissionPrompt(CLIPBOARD_WRITE_PERMISSION); } - lastEmojiSearchSettings = optionValue; - return Promise.resolve(); }