mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-09-19 20:51:28 +02:00
Stop refresh animation on popup when not on youtube page
This commit is contained in:
parent
742eb7ef57
commit
154bb1749d
2 changed files with 10 additions and 3 deletions
|
@ -258,7 +258,12 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||
break;
|
||||
case "refreshSegments":
|
||||
// update video on refresh if videoID invalid
|
||||
if (!getVideoID()) checkVideoIDChange();
|
||||
if (!getVideoID()) {
|
||||
checkVideoIDChange().then(() => {
|
||||
// if still no video ID found, return an empty info to the popup
|
||||
if (!getVideoID()) chrome.runtime.sendMessage({ message: "infoUpdated" });
|
||||
});
|
||||
}
|
||||
// fetch segments
|
||||
sponsorsLookup(false);
|
||||
|
||||
|
|
|
@ -465,8 +465,8 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||
return;
|
||||
}
|
||||
|
||||
//if request is undefined, then the page currently being browsed is not YouTube
|
||||
if (request != undefined) {
|
||||
// if request has no field other than message, then the page currently being browsed is not YouTube
|
||||
if (request.found != undefined) {
|
||||
//remove loading text
|
||||
PageElements.mainControls.style.display = "block";
|
||||
if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
|
||||
|
@ -490,6 +490,8 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||
|
||||
PageElements.issueReporterImportExport.classList.remove("hidden");
|
||||
}
|
||||
} else {
|
||||
displayNoVideo();
|
||||
}
|
||||
|
||||
//see if whitelist button should be swapped
|
||||
|
|
Loading…
Reference in a new issue