mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 04:27:15 +03:00
Merge pull request #1979 from HanYaodong/dev_refresh
[Fix] Stop Refresh Animation on Popup When Triggered on Non-YouTube Pages
This commit is contained in:
@@ -258,7 +258,12 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||||||
break;
|
break;
|
||||||
case "refreshSegments":
|
case "refreshSegments":
|
||||||
// update video on refresh if videoID invalid
|
// 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
|
// fetch segments
|
||||||
sponsorsLookup(false);
|
sponsorsLookup(false);
|
||||||
|
|
||||||
|
|||||||
@@ -465,8 +465,8 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if request is undefined, then the page currently being browsed is not YouTube
|
// if request has no field other than message, then the page currently being browsed is not YouTube
|
||||||
if (request != undefined) {
|
if (request.found != undefined) {
|
||||||
//remove loading text
|
//remove loading text
|
||||||
PageElements.mainControls.style.display = "block";
|
PageElements.mainControls.style.display = "block";
|
||||||
if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
|
if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
|
||||||
@@ -490,6 +490,8 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
|
|
||||||
PageElements.issueReporterImportExport.classList.remove("hidden");
|
PageElements.issueReporterImportExport.classList.remove("hidden");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
displayNoVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
//see if whitelist button should be swapped
|
//see if whitelist button should be swapped
|
||||||
|
|||||||
Reference in New Issue
Block a user