From 0d9f66c097bc3dc3a16e9b34701e9a8ee6d1def3 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Thu, 2 Nov 2023 12:32:35 +0100 Subject: [PATCH] www: fix edge config to go on default by default --- www/app/lib/edgeConfig.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/app/lib/edgeConfig.ts b/www/app/lib/edgeConfig.ts index 5291a79a..1fdf77b6 100644 --- a/www/app/lib/edgeConfig.ts +++ b/www/app/lib/edgeConfig.ts @@ -39,11 +39,13 @@ export async function getConfig(domain: string) { } let config = await get(edgeDomainToKey(domain)); - console.warn("No config for this domain, falling back to default"); - config = await get(edgeDomainToKey("default")); + if (typeof config !== "object") { + console.warn("No config for this domain, falling back to default"); + config = await get(edgeDomainToKey("default")); + } - if (typeof config !== "object") throw Error("Error fetchig config"); + if (typeof config !== "object") throw Error("Error fetching config"); return config as DomainConfig; }