Skip to content

Commit

Permalink
bug fix for dupe rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
tehstone committed Dec 7, 2024
1 parent b93a196 commit f6134dd
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions wayfarer-keyboard-review.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Wayfarer Keyboard Review
// @version 2.1.1
// @version 2.1.2
// @description Add keyboard review to Wayfarer
// @namespace https://github.com/tehstone/wayfarer-addons
// @downloadURL https://github.com/tehstone/wayfarer-addons/raw/main/wayfarer-keyboard-review.user.js
Expand Down Expand Up @@ -594,17 +594,12 @@
const dupKeys = {
'Enter': () => {
if (!isDialogOpen()) {
let dupeBtn = document.getElementById('wayfarerrtssbutton_d');
if (dupeBtn) {
dupeBtn.click();
} else {
document.querySelectorAll('#check-duplicates-card .agm-info-window-content button.wf-button--primary');
for (let i = 0; i < dupeBtn.length; i++) {
if (dupeBtn[i] && dupeBtn[i].closest('body')) {
dupeBtn[i].click();
awaitElement(() => document.querySelector('mat-dialog-container > *')).then(() => redrawUI());
break;
}
document.querySelectorAll('#check-duplicates-card .agm-info-window-content button.wf-button--primary');
for (let i = 0; i < dupeBtn.length; i++) {
if (dupeBtn[i] && dupeBtn[i].closest('body')) {
dupeBtn[i].click();
awaitElement(() => document.querySelector('mat-dialog-container > *')).then(() => redrawUI());
break;
}
}
} else {
Expand Down Expand Up @@ -737,6 +732,9 @@
console.log("handleEnterNew");
if (isDialogOpen() && !isDialogClosing()) {
btn = document.getElementById('wayfarerrtssbutton_r');
if (!btn) {
btn = document.getElementById('wayfarerrtssbutton_d');
}
if (!btn) {
btn = document.querySelector('mat-dialog-container .mat-dialog-actions button.wf-button--primary');
}
Expand Down

0 comments on commit f6134dd

Please sign in to comment.