Skip to content

Commit 15ae2d4

Browse files
committed
derive aggregation key in UI
1 parent 3e07a3d commit 15ae2d4

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/routes/(console)/organization-[organization]/billing/+page.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => {
9696
nextPlan: billingPlanDowngrade,
9797
// expose pagination for components
9898
limit: getLimit(url, route, 5),
99-
offset: pageToOffset(getPage(url) || 1, getLimit(url, route, 5)),
100-
// unique key to force component refresh on page change
101-
aggregationKey: `agg:${getPage(url) || 1}:${getLimit(url, route, 5)}`
99+
offset: pageToOffset(getPage(url) || 1, getLimit(url, route, 5))
102100
};
103101
};

src/routes/(console)/organization-[organization]/billing/planSummary.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@
3131
availableCredit = undefined,
3232
currentAggregation = undefined,
3333
limit = undefined,
34-
offset = undefined,
35-
aggregationKey = undefined
34+
offset = undefined
3635
}: {
3736
currentPlan: Plan;
3837
nextPlan?: Plan | null;
3938
availableCredit?: number | undefined;
4039
currentAggregation?: AggregationTeam | undefined;
4140
limit?: number | undefined;
4241
offset?: number | undefined;
43-
aggregationKey?: string | undefined;
4442
} = $props();
4543
4644
let showCancel = $state(false);
@@ -170,6 +168,10 @@
170168
0
171169
);
172170
171+
const aggregationKey = $derived(
172+
`agg:${Number(page.url.searchParams.get('page')) || 1}:${projectsLimit}`
173+
);
174+
173175
function getBillingData(currentPlan, currentAggregation, isSmallViewport) {
174176
const projectsList = getProjectsList(currentAggregation);
175177
const basePlan = {

0 commit comments

Comments
 (0)