diff --git a/src/renderer/views/Channel/Channel.vue b/src/renderer/views/Channel/Channel.vue index e6f0c71b9e486..f01a29a05fddb 100644 --- a/src/renderer/views/Channel/Channel.vue +++ b/src/renderer/views/Channel/Channel.vue @@ -230,7 +230,7 @@

{ @@ -2225,74 +2226,80 @@ const showFetchMoreButton = computed(() => { } }) -function handleFetchMore() { +async function handleFetchMore() { + if (isFetchMoreLoading.value) return + + isFetchMoreLoading.value = true + switch (currentTab.value) { case 'videos': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getChannelVideosLocalMore() + await getChannelVideosLocalMore() } else { - channelInvidiousVideos() + await channelInvidiousVideos() } break case 'shorts': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getChannelShortsLocalMore() + await getChannelShortsLocalMore() } else { - channelInvidiousShorts() + await channelInvidiousShorts() } break case 'live': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getChannelLiveLocalMore() + await getChannelLiveLocalMore() } else { - channelInvidiousLive() + await channelInvidiousLive() } break case 'releases': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getChannelReleasesLocalMore() + await getChannelReleasesLocalMore() } else { - channelInvidiousReleasesMore() + await channelInvidiousReleasesMore() } break case 'podcasts': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getChannelPodcastsLocalMore() + await getChannelPodcastsLocalMore() } else { - channelInvidiousPodcastsMore() + await channelInvidiousPodcastsMore() } break case 'courses': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getChannelCoursesLocalMore() + await getChannelCoursesLocalMore() } else { - channelInvidiousCoursesMore() + await channelInvidiousCoursesMore() } break case 'playlists': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getChannelPlaylistsLocalMore() + await getChannelPlaylistsLocalMore() } else { - getPlaylistsInvidiousMore() + await getPlaylistsInvidiousMore() } break case 'search': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - searchChannelLocal() + await searchChannelLocal() } else { - searchChannelInvidious() + await searchChannelInvidious() } break case 'community': if (process.env.SUPPORTS_LOCAL_API && apiUsed === 'local') { - getCommunityPostsLocalMore() + await getCommunityPostsLocalMore() } else { - getCommunityPostsInvidious() + await getCommunityPostsInvidious() } break default: console.error(currentTab.value) } + + isFetchMoreLoading.value = false } function changeTab(tab) {