fixed infinite scroll skeleton switching/loading bug

This commit is contained in:
Victor committed 2023-12-27 00:33:01 -05:00
1 parent a2c5c2c484
commit f062eabd8a
3 files changed
+4 -4

No files matched your search

@@ -37,7 +37,7 @@ export default function FeaturedTab() {
</Link>
</div>
{ media.isLoading ? (
{ media.isLoading && !media.list.length ? (
<div className="row gx-3 gy-3">
{Array.from({ length: 12 }).map((_, index) => (
<SkeletonCard key={index} />
@@ -21,7 +21,7 @@ export default function MediaTab() {
const [showMasonryGrid, setShowMasonryGrid] = useState(true);
const [list, listSet] = useState<MediaFile[]>([]);
const media = useLazyLists({
debug: "aaaa",
debug: "explore media tab",
fetcher: ListMediaFiles,
list,
listSet,
@@ -69,7 +69,7 @@ export default function MediaTab() {
</div>
</div>
<AudioPlayerProvider>
{ media.isLoading ? (
{ media.isLoading && !media.list.length ? (
<div className="row gx-3 gy-3">
{Array.from({ length: 12 }).map((_, index) => (
<SkeletonCard key={index} />
@@ -106,7 +106,7 @@ export default function WeightsTab() {
</div>
</div>
<AudioPlayerProvider>
{ weights.isLoading ? (
{ weights.isLoading && !weights.list.length ? (
<div className="row gx-3 gy-3">
{Array.from({ length: 12 }).map((_, index) => (
<SkeletonCard key={index} />