From b009b2a87d171909248aeb11ab4145a1ceeacf62 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 15 Jun 2024 14:15:08 +0200 Subject: [PATCH] fix: race conditions when when loading lots of videos quickly --- src/components/ChannelPage.vue | 10 +++++----- src/components/CollapsableText.vue | 4 ++-- src/components/FeedPage.vue | 2 +- src/components/WatchVideo.vue | 7 +++---- src/main.js | 1 - 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/components/ChannelPage.vue b/src/components/ChannelPage.vue index 56e586ba..9ff58751 100644 --- a/src/components/ChannelPage.vue +++ b/src/components/ChannelPage.vue @@ -183,8 +183,8 @@ export default { this.channel.nextpage = json.nextpage; this.loading = false; this.updateWatched(json.relatedStreams); - json.relatedStreams.map(stream => this.contentItems.push(stream)); - this.fetchDeArrowContent(this.contentItems); + this.contentItems.push(...json.relatedStreams); + this.fetchDeArrowContent(json.relatedStreams); }); }, fetchChannelTabNextPage() { @@ -194,8 +194,8 @@ export default { }).then(json => { this.tabs[this.selectedTab].tabNextPage = json.nextpage; this.loading = false; - json.content.map(item => this.contentItems.push(item)); - this.fetchDeArrowContent(this.contentItems); + json.this.contentItems.push(...json.content); + this.fetchDeArrowContent(json.content); this.tabs[this.selectedTab].content = this.contentItems; }); }, @@ -246,7 +246,7 @@ export default { data: this.tabs[index].data, }).then(tab => { this.contentItems = this.tabs[index].content = tab.content; - this.fetchDeArrowContent(this.contentItems); + this.fetchDeArrowContent(tab.content); this.tabs[this.selectedTab].tabNextPage = tab.nextpage; }); }, diff --git a/src/components/CollapsableText.vue b/src/components/CollapsableText.vue index 0de1e858..dc65b932 100644 --- a/src/components/CollapsableText.vue +++ b/src/components/CollapsableText.vue @@ -1,5 +1,5 @@ -