From d80dad796317441fefc053a57f66d7e5de5f8602 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Sun, 13 Dec 2020 20:29:23 +0100 Subject: [PATCH] fix(types): change wrong type of 'types' --- src/content.ts | 2 +- src/js-components/previewBar.ts | 4 ++-- src/utils.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content.ts b/src/content.ts index d3ad709d..87b24552 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1092,7 +1092,7 @@ function createButton(baseID, title, callback, imageName, isDraggable=false): bo return true; } -function getControls(): HTMLElement | boolean { +function getControls(): HTMLElement | false { const controlsSelectors = [ // YouTube ".ytp-right-controls", diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index d7ec7a43..f5ab07fa 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -16,7 +16,7 @@ class PreviewBar { onInvidious: boolean; timestamps: number[][]; - types: string; + types: string[]; constructor(parent: any, onMobileYouTube: boolean, onInvidious: boolean) { this.container = document.createElement('ul'); @@ -137,7 +137,7 @@ class PreviewBar { } } - set(timestamps: number[][], types: string, duration: number): void { + set(timestamps: number[][], types: string[], duration: number): void { while (this.container.firstChild) { this.container.removeChild(this.container.firstChild); } diff --git a/src/utils.ts b/src/utils.ts index 9a515e38..6e4f2a28 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -24,7 +24,7 @@ class Utils { } // Function that can be used to wait for a condition before returning - async wait(condition: () => boolean, timeout = 5000, check = 100): Promise { + async wait(condition: () => HTMLElement | boolean, timeout = 5000, check = 100): Promise { return await new Promise((resolve, reject) => { setTimeout(() => reject("TIMEOUT"), timeout);