Improve the performance of the side nav (#3743)

This commit is contained in:
absidue
2023-07-10 22:43:08 -04:00
committed by GitHub
parent 35074efbdd
commit 11eee77dab
+11 -8
View File
@@ -29,8 +29,9 @@ export default defineComponent({
return this.$store.getters.getActiveProfile
},
activeSubscriptions: function () {
const profile = JSON.parse(JSON.stringify(this.activeProfile))
return profile.subscriptions.sort((a, b) => {
const subscriptions = JSON.parse(JSON.stringify(this.activeProfile.subscriptions))
subscriptions.sort((a, b) => {
const nameA = a.name.toLowerCase()
const nameB = b.name.toLowerCase()
if (nameA < nameB) {
@@ -40,13 +41,15 @@ export default defineComponent({
return 1
}
return 0
}).map((channel) => {
if (this.backendPreference === 'invidious') {
channel.thumbnail = youtubeImageUrlToInvidious(channel.thumbnail, this.currentInvidiousInstance)
}
return channel
})
if (this.backendPreference === 'invidious') {
subscriptions.forEach((channel) => {
channel.thumbnail = youtubeImageUrlToInvidious(channel.thumbnail, this.currentInvidiousInstance)
})
}
return subscriptions
},
hidePopularVideos: function () {
return this.$store.getters.getHidePopularVideos