Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into channelTrailer

This commit is contained in:
Michael C
2021-12-31 17:30:17 -05:00
7 changed files with 13 additions and 16 deletions

View File

@@ -27,7 +27,10 @@ export default class Utils {
/** Function that can be used to wait for a condition before returning. */
async wait<T>(condition: () => T | false, timeout = 5000, check = 100): Promise<T> {
return await new Promise((resolve, reject) => {
setTimeout(() => reject("TIMEOUT"), timeout);
setTimeout(() => {
clearInterval(interval);
reject("TIMEOUT");
}, timeout);
const intervalCheck = () => {
const result = condition();