From 84f0cb41bb8cac00ac42106a350d7bd56842bd6d Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 6 Jan 2024 13:23:08 -0800 Subject: [PATCH] fix: restore status toast --- src/lib/components/chat/SettingsModal.svelte | 50 +++++++++++--------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index e0f04d82..108e631c 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -295,11 +295,16 @@ digest: data.digest }; } + } else { + toast.success(data.status); } } } } catch (error) { console.log(error); + if (typeof error !== 'string') { + error = error.message; + } opts.callback({ success: false, error, modelName: opts.modelName }); } } @@ -330,11 +335,10 @@ if (!data.success) { toast.error(data.error); - return; + } else { + toast.success(`Model ${modelName} was successfully downloaded`); + models.set(await getModels()); } - - toast.success(`Model ${modelName} was successfully downloaded`); - models.set(await getModels()); } ); @@ -1155,32 +1159,34 @@ -
+
To access the available model names for downloading, click here.
-
- {#if Object.keys(modelDownloadStatus).length > 0} - {#each Object.entries(modelDownloadStatus) as [modelName, payload]} -
-
{modelName}
-
-
- {payload.pullProgress ?? 0}% -
-
- {payload.digest} + + {#if Object.keys(modelDownloadStatus).length > 0} + {#each Object.entries(modelDownloadStatus) as [modelName, payload]} +
+
{modelName}
+
+
+ {payload.pullProgress ?? 0}% +
+
+ {payload.digest} +
-
- {/each} - {/if} + {/each} + {/if} +
+