Skip to content

Commit 29b246c

Browse files
committed
temp fix
1 parent c26eaa0 commit 29b246c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

MyMusicClientSveltePwa/src/lib/pages/Playlists.svelte

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
let updating = false
1212
1313
export let playlistId = -1;
14+
let visibleCount = 100;
15+
16+
function loadMore() {
17+
visibleCount += 100;
18+
}
1419
1520
let songs = writable([]);
1621
@@ -39,11 +44,16 @@
3944

4045
{#if $songs.length > 0}
4146
<div class="row">
42-
{#each $songs as song}
47+
{#each $songs.slice(0, visibleCount) as song}
4348
<div class="col-12 col-lg-4">
4449
<SongComponent {song} {playlistId} />
4550
</div>
4651
{/each}
52+
{#if visibleCount < $songs.length}
53+
<div class="col-12 text-center my-3">
54+
<button class="btn btn-primary" on:click={loadMore}>Load More</button>
55+
</div>
56+
{/if}
4757
</div>
4858
{:else}
4959
<p>No songs in playlist.</p>

0 commit comments

Comments
 (0)