diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 8b13789..0000000 --- a/manifest.json +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/automations/Swiper.js b/src/automations/Swiper.js index 12d2790..7e1b02b 100644 --- a/src/automations/Swiper.js +++ b/src/automations/Swiper.js @@ -55,7 +55,7 @@ class Swiper { matchFound = () => { const found = document.querySelectorAll('button[aria-label="Close"]'); - if (!found || !found.length) { + if (typeof found?.click !== 'function') { return false; } @@ -84,12 +84,12 @@ class Swiper { }, 100); } - if (this.interactions.closeInstructions(this.run)) { - return; + if (this.interactions.closeInstructions()) { + return setTimeout(this.run, generateRandomNumber()); } - if (this.interactions.closeSuperLike(this.run)) { - return; + if (this.interactions.closeModal()) { + return setTimeout(this.run, generateRandomNumber()); } if (!this.canSwipe()) { diff --git a/src/misc/Interactions.js b/src/misc/Interactions.js index 12f2cbd..0af1348 100644 --- a/src/misc/Interactions.js +++ b/src/misc/Interactions.js @@ -25,7 +25,7 @@ class Interactions { } }; - closeInstructions = (cb) => { + closeInstructions = () => { // Homescreen modal blocks us try { if (document.querySelector('[data-testid="addToHomeScreen"]')) { @@ -40,12 +40,12 @@ class Interactions { } catch (e) {} }; - closeSuperLike = (cb) => { - // "Upgrade your like" modal blocks us + closeModal = () => { try { - if (document.querySelector('#modal-manager [aria-label="⭐"]')) { - document.querySelector('#modal-manager button:nth-of-type(2)').click(); - logger('Closing upgrade super like modal'); + const modal = document.querySelector('#modal-manager'); + if (modal) { + document.querySelector('#modal-manager > div').click(); + logger('Closing modal'); cb(); return true; }