mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into improvements
# Conflicts: # manifest/manifest.json # src/components/SponsorTimeEditComponent.tsx # src/config.ts # src/content.ts # src/types.ts
This commit is contained in:
@@ -23,8 +23,8 @@ export default class Utils {
|
||||
this.backgroundScriptContainer = backgroundScriptContainer;
|
||||
}
|
||||
|
||||
// Function that can be used to wait for a condition before returning
|
||||
async wait(condition: () => HTMLElement | boolean, timeout = 5000, check = 100): Promise<HTMLElement | boolean> {
|
||||
/** 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user