mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-09-20 04:53:43 +02:00
Fixed channel ID promise
This commit is contained in:
parent
de66e21d14
commit
070a51954a
1 changed files with 4 additions and 2 deletions
|
@ -224,7 +224,9 @@ function videoIDChange(id) {
|
|||
//id is not valid
|
||||
if (!id) return;
|
||||
|
||||
let channelIDPromise = Utils.wait(getChannelID);
|
||||
// TODO: Use a better method here than using type any
|
||||
// This is done to be able to do channelIDPromise.isFulfilled and channelIDPromise.isRejected
|
||||
let channelIDPromise: any = Utils.wait(getChannelID);
|
||||
channelIDPromise.then(() => channelIDPromise.isFulfilled = true).catch(() => channelIDPromise.isRejected = true);
|
||||
|
||||
//setup the preview bar
|
||||
|
@ -341,7 +343,7 @@ function sponsorsLookup(id: string, channelIDPromise = null) {
|
|||
//check database for sponsor times
|
||||
//made true once a setTimeout has been created to try again after a server error
|
||||
let recheckStarted = false;
|
||||
sendRequestToServer('GET', "/api/getVideoSponsorTimes?videoID=" + id, function(xmlhttp) {
|
||||
Utils.sendRequestToServer('GET', "/api/getVideoSponsorTimes?videoID=" + id, function(xmlhttp) {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
sponsorDataFound = true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue