From f46748375348a39fc63453d11d1a6c4aa04e6163 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 24 Feb 2024 18:51:13 -0800 Subject: [PATCH] fix: error handling --- src/lib/components/chat/Settings/Images.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/components/chat/Settings/Images.svelte b/src/lib/components/chat/Settings/Images.svelte index a2be0ab4..cf64b7d4 100644 --- a/src/lib/components/chat/Settings/Images.svelte +++ b/src/lib/components/chat/Settings/Images.svelte @@ -27,7 +27,7 @@ let AUTOMATIC1111_BASE_URL = ''; let selectedModel = ''; - let models = []; + let models = null; let imageSize = ''; let steps = 50; @@ -35,7 +35,7 @@ const getModels = async () => { models = await getDiffusionModels(localStorage.token).catch((error) => { toast.error(error); - return []; + return null; }); selectedModel = await getDefaultDiffusionModel(localStorage.token).catch((error) => { return ''; @@ -198,7 +198,7 @@ {#if !selectedModel} {/if} - {#each models as model} + {#each models ?? [] as model}