Only show refresh button in popup if segments are found

This commit is contained in:
Ajay Ramachandran
2021-07-16 12:37:38 -04:00
parent 797c9d67e4
commit 777f3a2769
2 changed files with 3 additions and 1 deletions

View File

@@ -18,7 +18,7 @@
<p id="loadingIndicator">__MSG_noVideoID__</p>
<!-- If the video was found in the database -->
<p id="videoFound"></p>
<button class="sbSlimButton" id="refreshSegmentsButton" title="__MSG_refreshSegments__">
<button class="sbSlimButton hidden" id="refreshSegmentsButton" title="__MSG_refreshSegments__">
<img id="refreshSegments" src="/icons/refresh.svg"/>
</button>
</div>

View File

@@ -292,10 +292,12 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
if (request.found) {
PageElements.videoFound.innerHTML = chrome.i18n.getMessage("sponsorFound");
PageElements.refreshSegmentsButton.classList.remove("hidden");
displayDownloadedSponsorTimes(request);
} else {
PageElements.videoFound.innerHTML = chrome.i18n.getMessage("sponsor404");
PageElements.refreshSegmentsButton.classList.add("hidden");
}
}