From 809be3b2fbf65758c5dae7770c0959c8cbe06278 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 3 Aug 2019 20:52:09 -0400 Subject: [PATCH] Fixed submit button disappearing after already submitting once. --- content.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/content.js b/content.js index c838b956..6ed587d0 100644 --- a/content.js +++ b/content.js @@ -965,9 +965,15 @@ function sendSubmitMessage(){ //finish this animation submitButton.style.animation = "rotate 1s"; //when the animation is over, hide the button - submitButton.addEventListener("animationend", function() { + let animationEndListener = function() { changeStartSponsorButton(true, false); - }); + + submitButton.style.animation = "none"; + + submitButton.removeEventListener("animationend", animationEndListener); + }; + + submitButton.addEventListener("animationend", animationEndListener); //clear the sponsor times let sponsorTimeKey = "sponsorTimes" + currentVideoID;