From ede29e98b724e6bae489fb0269efc5adbd824425 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 26 Nov 2024 15:30:35 -0800 Subject: [PATCH] refac --- .../admin/Settings/Models/ConfigureModelsModal.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte b/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte index c62afc332..c78e04388 100644 --- a/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte +++ b/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte @@ -51,8 +51,11 @@ onMount(async () => { config = await getModelsConfig(localStorage.token); - defaultModelIds = (config?.DEFAULT_MODELS ?? '').split(',').filter((id) => id); - + if (config?.DEFAULT_MODELS) { + defaultModelIds = (config?.DEFAULT_MODELS).split(',').filter((id) => id); + } else { + defaultModelIds = []; + } const modelOrderList = config.MODEL_ORDER_LIST || []; const allModelIds = $models.map((model) => model.id);