diff --git a/src/components/cards/CardsOverview.svelte b/src/components/cards/CardsOverview.svelte index 287df51f..49f96d04 100644 --- a/src/components/cards/CardsOverview.svelte +++ b/src/components/cards/CardsOverview.svelte @@ -32,7 +32,7 @@ export let original_data = {}; export let current_cards = []; export const addCards = (cards) => { - console.log(cards) + console.log(cards); current_cards = current_cards.concat(...cards); options.update((options) => ({ ...options, @@ -155,15 +155,29 @@ }).showToast(); } - onMount(() => { - RunnerCardService.runnerCardControllerGetAll().then((val) => { - current_cards = val; + onMount(async () => { + let page = 0; + while (page >= 0) { + const cards = await RunnerCardService.runnerCardControllerGetAll( + page, + 500 + ); + if (cards.length == 0) { + page = -2; + } + + current_cards = current_cards.concat(...cards); options.update((options) => ({ ...options, data: current_cards, })); - dataLoaded = true; - }); + + if (page == 0) { + dataLoaded = true; + } + page++; + } + console.log("All cards loaded"); }); @@ -229,7 +243,7 @@ ...options, data: current_cards, })); - $table.resetRowSelection() + $table.resetRowSelection(); }} > {$_("delete-cards")} @@ -249,7 +263,10 @@ {/if} - 0} bind:generate_cards={selectedCards} /> + 0} + bind:generate_cards={selectedCards} + />