From 1197d09e4dada3c2efc5ee116fb219e8149d2e96 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Jan 2022 11:24:18 +0530 Subject: [PATCH] Don't call the SponsorBlock API if no segments are to be skipped --- src/routes/WatchVideo.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/WatchVideo.vue b/src/routes/WatchVideo.vue index 71f6b6f..5301d41 100644 --- a/src/routes/WatchVideo.vue +++ b/src/routes/WatchVideo.vue @@ -248,10 +248,14 @@ export default { if (!this.$store.getters['prefs/getPreference']('sponsorblock', true)) { return } + const selectedSkip = this.$store.getters['prefs/getPreference']('selectedSkip') + if (selectedSkip.length === 0) { + return + } this.sponsors = await this.$store.dispatch('auth/makeRequest', { path: '/sponsors/' + this.videoId, params: { - category: JSON.stringify(this.$store.getters['prefs/getPreference']('selectedSkip')) + category: JSON.stringify() } }) },