diff --git a/src/routes/(pages)/(clients)/+layout.server.ts b/src/routes/(pages)/(clients)/+layout.server.ts index 1c4a85b..3c2385b 100644 --- a/src/routes/(pages)/(clients)/+layout.server.ts +++ b/src/routes/(pages)/(clients)/+layout.server.ts @@ -1,5 +1,6 @@ import logger from "$lib/logger"; import type { TPublicChannel, TPublicTenant } from "$lib/types/public"; +import { getCurrentTranslation } from "$lib/utils/localizations"; import type { LayoutServerLoad } from "./$types"; const log = logger.setContext(import.meta.filename); @@ -33,7 +34,11 @@ export const load: LayoutServerLoad = async (event) => { .then(async (res) => { try { const body = await res.json(); - return body.channels || ([] as TPublicChannel[]); + return ( + body.channels.sort((a: TPublicChannel, b: TPublicChannel) => + getCurrentTranslation(a.names).localeCompare(getCurrentTranslation(b.names)), + ) || ([] as TPublicChannel[]) + ); } catch (error) { log.error("Failed to parse settings base response", { error }); }