From 5de47a74f2d4816e9c830d80b72c1456be53355b Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 27 Aug 2024 21:08:47 +0200 Subject: [PATCH] Feat/sort track events (#710) * feat: sort track events Signed-off-by: David Dal Busco * feat: sort track events Signed-off-by: David Dal Busco --------- Signed-off-by: David Dal Busco --- .../lib/components/analytics/AnalyticsEvents.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/lib/components/analytics/AnalyticsEvents.svelte b/src/frontend/src/lib/components/analytics/AnalyticsEvents.svelte index 2960b5204..0ae70c66d 100644 --- a/src/frontend/src/lib/components/analytics/AnalyticsEvents.svelte +++ b/src/frontend/src/lib/components/analytics/AnalyticsEvents.svelte @@ -5,7 +5,15 @@ export let trackEvents: AnalyticsTrackEvents; let total: Array<[string, number]>; - $: ({ total } = trackEvents); + + const setTotal = () => { + const { total: t } = trackEvents; + t.sort(([keyA, _], [keyB, __]) => keyA.localeCompare(keyB)); + + total = t; + }; + + $: trackEvents, setTotal();