diff options
author | Ajay Ramachandran <[email protected]> | 2022-06-15 13:08:02 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-06-15 13:08:02 -0400 |
commit | 8097eff9bbd891f2d43eecba238a9ecc80d90a05 (patch) | |
tree | bbbc30ab2ecd3d40845971997d01cc3d9471dc6d | |
parent | c61c97ccadc81b0e4189f9a5a8cfad1738eaecd4 (diff) | |
parent | 05eed6ee206e784345efa0335f30336210a709ce (diff) | |
download | SponsorBlock-8097eff9bbd891f2d43eecba238a9ecc80d90a05.tar.gz SponsorBlock-8097eff9bbd891f2d43eecba238a9ecc80d90a05.zip |
Merge pull request #1355 from Argn0/branch3
display "Voted!" message only momentarily
-rw-r--r-- | src/popup.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/popup.ts b/src/popup.ts index 0dc88176..bb6bcc29 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -714,6 +714,17 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> { thanksForVotingText.innerText = message; } + function removeVoteMessage(UUID) { + const voteButtonsContainer = document.getElementById("sponsorTimesVoteButtonsContainer" + UUID); + voteButtonsContainer.style.display = "block"; + + const voteStatusContainer = document.getElementById("sponsorTimesVoteStatusContainer" + UUID); + voteStatusContainer.style.display = "none"; + + const thanksForVotingText = document.getElementById("sponsorTimesThanksForVotingText" + UUID); + thanksForVotingText.removeAttribute("innerText"); + } + function vote(type, UUID) { //add loading info addVoteMessage(chrome.i18n.getMessage("Loading"), UUID); @@ -737,6 +748,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> { } else if (response.successType == -1) { addVoteMessage(GenericUtils.getErrorMessage(response.statusCode, response.responseText), UUID); } + setTimeout(() => removeVoteMessage(UUID), 1500); } } ); |