Skip to content

Commit

Permalink
Invalidate balance load function
Browse files Browse the repository at this point in the history
Because the trips page is a child of the account page where the balance is loaded, we have to invalidate the load function for the balance to update.
  • Loading branch information
kiwijos committed Jan 18, 2024
1 parent d6139ea commit ffb6378
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/routes/(main)/me/account/trips/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import VerticalTable from '$lib/components/VerticalTable.svelte';
import EndTripButton from '$lib/components/EndTripButton.svelte';
import type { TripCompleted } from '$lib/types/TripCompleted';
import { invalidate } from '$app/navigation';
let currentTab = 0;
Expand Down Expand Up @@ -118,6 +119,8 @@
};
const updateTrip = (e: CustomEvent<TripCompleted>) => {
invalidate('server:balance');
const trip = e.detail;
const index = formattedTrips.findIndex((t) => t.id === trip.id);
Expand Down

0 comments on commit ffb6378

Please sign in to comment.