Fix for feed when no videos are loaded

This commit is contained in:
Brahim Hadriche committed 2023-10-25 21:22:22 -04:00
1 parent 586925c2da
commit 4827537f57
1 file changed
+15 -2
@@ -124,7 +124,12 @@
try { try {
const result = await invidiousApi.makeRequest(feedSource); const result = await invidiousApi.makeRequest(feedSource);
if (!result) { if (!result) {
return; feedSource.state.loadState = FeedLoadState.Error;
feedSourcesIndex++;
if (feedSourcesIndex >= feedSources.length) {
feedLoadState = FeedLoadState.Loaded;
}
continue;
} }
const hasContinuation = !!result.continuation; const hasContinuation = !!result.continuation;
@@ -225,6 +230,11 @@
} }
</script> </script>
<!-- Hide rows that are loaded but have no videos. Typically a
disabled feed (like popular) or unauthenticated.
TODO:P0 show action nodes (action to login)
-->
{#if feedLoadState !== FeedLoadState.Loaded || videos.length !== 0}
<div class="text-lg font-semibold m-4"> <div class="text-lg font-semibold m-4">
{feed.title} {feed.title}
</div> </div>
@@ -235,7 +245,9 @@
on:scroll={recalculateVisibileCells} on:scroll={recalculateVisibileCells}
> >
{#each videos as video, i} {#each videos as video, i}
<div class="carousel-item {video.type === 'channel' ? 'w-60' : 'w-80'} p-2"> <div
class="carousel-item {video.type === 'channel' ? 'w-60' : 'w-80'} p-2"
>
{#if i >= scrollStart && i <= scrollEnd} {#if i >= scrollStart && i <= scrollEnd}
{#if video.type === "video"} {#if video.type === "video"}
<VideoCell {...video} /> <VideoCell {...video} />
@@ -248,3 +260,4 @@
</div> </div>
{/each} {/each}
</div> </div>
{/if}