Don't call the SponsorBlock API if no segments are to be skipped

This commit is contained in:
root
2022-01-20 11:24:18 +05:30
parent 7c06a8ad2a
commit 1197d09e4d
+5 -1
View File
@@ -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()
}
})
},