Skip to content

Commit

Permalink
Fix subscriptions double loading on launch (FreeTubeApp#5930)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Oct 24, 2024
1 parent 7ebc910 commit 9e00e06
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineComponent({
data: function () {
return {
isLoading: true,
alreadyLoadedRemotely: false,
postList: [],
errorChannels: [],
attemptedFetch: false,
Expand Down Expand Up @@ -97,7 +98,9 @@ export default defineComponent({
},

subscriptionCacheReady() {
this.loadPostsFromCacheSometimes()
if (!this.alreadyLoadedRemotely) {
this.loadPostsFromCacheSometimes()
}
},
},
mounted: async function () {
Expand All @@ -115,6 +118,7 @@ export default defineComponent({
return
}

this.alreadyLoadedRemotely = true
this.loadPostsForSubscriptionsFromRemote()
this.$store.commit('setSubscriptionForCommunityPostsFirstAutoFetchRun')
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineComponent({
data: function () {
return {
isLoading: true,
alreadyLoadedRemotely: false,
videoList: [],
errorChannels: [],
attemptedFetch: false,
Expand Down Expand Up @@ -107,7 +108,9 @@ export default defineComponent({
},

subscriptionCacheReady() {
this.loadVideosFromCacheSometimes()
if (!this.alreadyLoadedRemotely) {
this.loadVideosFromCacheSometimes()
}
},
},
mounted: async function () {
Expand All @@ -125,6 +128,7 @@ export default defineComponent({
return
}

this.alreadyLoadedRemotely = true
this.loadVideosForSubscriptionsFromRemote()
this.$store.commit('setSubscriptionForLiveStreamsFirstAutoFetchRun')
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineComponent({
data: function () {
return {
isLoading: true,
alreadyLoadedRemotely: false,
videoList: [],
errorChannels: [],
attemptedFetch: false,
Expand Down Expand Up @@ -101,7 +102,9 @@ export default defineComponent({
},

subscriptionCacheReady() {
this.loadVideosFromCacheSometimes()
if (!this.alreadyLoadedRemotely) {
this.loadVideosFromCacheSometimes()
}
},
},
mounted: async function () {
Expand All @@ -119,6 +122,7 @@ export default defineComponent({
return
}

this.alreadyLoadedRemotely = true
this.loadVideosForSubscriptionsFromRemote()
this.$store.commit('setSubscriptionForShortsFirstAutoFetchRun')
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineComponent({
data: function () {
return {
isLoading: true,
alreadyLoadedRemotely: false,
videoList: [],
errorChannels: [],
attemptedFetch: false,
Expand Down Expand Up @@ -111,7 +112,9 @@ export default defineComponent({
},

subscriptionCacheReady() {
this.loadVideosFromCacheSometimes()
if (!this.alreadyLoadedRemotely) {
this.loadVideosFromCacheSometimes()
}
},
},
mounted: async function () {
Expand All @@ -129,6 +132,7 @@ export default defineComponent({
return
}

this.alreadyLoadedRemotely = true
this.loadVideosForSubscriptionsFromRemote()
this.$store.commit('setSubscriptionForVideosFirstAutoFetchRun')
},
Expand Down

0 comments on commit 9e00e06

Please sign in to comment.