Skip to content

Commit

Permalink
Fix with new ID
Browse files Browse the repository at this point in the history
  • Loading branch information
rugk committed Sep 15, 2019
1 parent b06ae00 commit a63f6b0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/options/modules/CustomOptionTriggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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
Expand All @@ -331,12 +329,9 @@ function applyEmojiSearch(optionValue, option, event = {}) {
reloadEmojiSearchStatus();
});
} else {
// debugger;
PermissionRequest.cancelPermissionPrompt(CLIPBOARD_WRITE_PERMISSION);
}

lastEmojiSearchSettings = optionValue;

return Promise.resolve();
}

Expand Down

0 comments on commit a63f6b0

Please sign in to comment.