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:
Ajay Ramachandran
2021-05-22 01:28:24 -04:00
57 changed files with 1383 additions and 828 deletions

View File

@@ -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);