Skip to content

Commit

Permalink
remove pagination from datasets/models pages
Browse files Browse the repository at this point in the history
  • Loading branch information
juansensio committed Jul 18, 2024
1 parent 0f8dbcd commit 4d4e083
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions ui/src/routes/datasets/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
loading = false;
show_liked = localStorage.getItem("show_liked") === "true";
filtered_datasets = JSON.parse(
localStorage.getItem("filtered_datasets")
localStorage.getItem("filtered_datasets"),
);
selected_tags = JSON.parse(localStorage.getItem("selected_tags")) || [];
};
Expand All @@ -46,17 +46,16 @@
});
if (show_liked) {
filtered_datasets = filtered_datasets.filter((dataset) =>
$user?.liked_datasets.includes(dataset.id)
$user?.liked_datasets.includes(dataset.id),
);
}
if (selected_qualities.length > 0) {
filtered_datasets = filtered_datasets?.filter((dataset) =>
selected_qualities?.includes(dataset.quality)
selected_qualities?.includes(dataset.quality),
);
}
}
const toggleLike = () => {
show_liked = $user && !show_liked;
localStorage.setItem("show_liked", show_liked);
Expand Down Expand Up @@ -117,7 +116,7 @@
</span>
{#if loading}
<div class="grid grid-cols-1 sm:grid-cols-3 gap-3 w-full mt-3">
{#each [1, 2, 3, 4, 5, 6, 7, 8, 9] as _}
{#each new Array(30) as _}
<Skeleton />
{/each}
</div>
Expand Down
10 changes: 5 additions & 5 deletions ui/src/routes/models/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
});
if (show_liked) {
filtered_models = filtered_models.filter((models) =>
$user?.liked_models.includes(models.id)
$user?.liked_models.includes(models.id),
);
}
if (selected_qualities.length > 0) {
filtered_models = filtered_models?.filter((model) =>
selected_qualities?.includes(model.quality)
selected_qualities?.includes(model.quality),
);
}
}
Expand Down Expand Up @@ -112,11 +112,11 @@
</span>
{#if loading}
<div class="grid grid-cols-1 sm:grid-cols-3 gap-3 w-full mt-3">
{#each [1, 2, 3, 4, 5, 6, 7, 8, 9] as _}
<Skeleton />
{#each new Array(30) as _}
<Skeleton />
{/each}
</div>
{:else if filtered_models?.length > 0}
{:else if filtered_models?.length > 0}
<div class="grid grid-cols-1 sm:grid-cols-3 gap-3 w-full mt-3">
{#each filtered_models as model}
<Card
Expand Down

0 comments on commit 4d4e083

Please sign in to comment.