Skip to content

Commit

Permalink
Merge pull request #216 from rainlanguage/2024-02-10-fix-fetch-first-…
Browse files Browse the repository at this point in the history
…page

refactor(tauri/ui): fetch first page of table in AppTable component
  • Loading branch information
thedavidmeister authored Feb 11, 2024
2 parents af2c410 + 7d7cdb7 commit fa6ee66
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tauri-app/src/lib/components/AppTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
export let emptyMessage: string = "None found"
export let rowHoverable = true;
export let enableCsvExport = true;
listStore.fetchFirst();
</script>

{#if $listStore.currentPage.length === 0}
Expand Down
1 change: 1 addition & 0 deletions tauri-app/src/lib/storesGeneric/listStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Unsubscriber = () => void;
export interface PaginatedCachedStore<T> {
subscribe: ( subscriber: Subscriber<Page<T>>, invalidate?: Invalidator<Page<T>>) => Unsubscriber,
fetchPage: (page?: number) => Promise<void>;
fetchFirst: () => Promise<void>;
fetchPrev: () => Promise<void>;
fetchNext: () => Promise<void>;
exportCsv: () => void;
Expand Down
1 change: 0 additions & 1 deletion tauri-app/src/routes/order-clears/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import { FileCsvOutline } from 'flowbite-svelte-icons';
redirectIfSettingsNotDefined();
orderClearsList.fetchFirst();
</script>

<PageHeader title="Order Clears" />
Expand Down
1 change: 0 additions & 1 deletion tauri-app/src/routes/orders/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import TableOrders from '$lib/components/TableOrders.svelte';
redirectIfSettingsNotDefined();
ordersList.fetchFirst();
</script>

<PageHeader title="Orders">
Expand Down
1 change: 0 additions & 1 deletion tauri-app/src/routes/vaults/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
}
const vaultListBalanceChanges = useVaultListBalanceChanges($page.params.id);
vaultListBalanceChanges.fetchFirst();
</script>

<PageHeader title="Vault">
Expand Down

0 comments on commit fa6ee66

Please sign in to comment.