refac
This commit is contained in:
1 parent
e61406c825
commit
824eeba56c
1 file changed
+9
@@ -2,6 +2,7 @@
|
||||
import { getModels, getTaskConfig, updateTaskConfig } from '$lib/apis';
|
||||
import { config, settings } from '$lib/stores';
|
||||
import { createEventDispatcher, onMount, getContext } from 'svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
import { getBaseModels } from '$lib/apis/models';
|
||||
|
||||
@@ -44,6 +45,7 @@
|
||||
let models = null;
|
||||
|
||||
const init = async () => {
|
||||
try {
|
||||
taskConfig = await getTaskConfig(localStorage.token);
|
||||
|
||||
workspaceModels = await getBaseModels(localStorage.token);
|
||||
@@ -69,6 +71,13 @@
|
||||
});
|
||||
|
||||
console.debug('models', models);
|
||||
} catch (err) {
|
||||
console.error('Failed to initialize Interface settings:', err);
|
||||
toast.error(
|
||||
err?.detail ?? err?.message ?? $i18n.t('Failed to load Interface settings')
|
||||
);
|
||||
models = [];
|
||||
}
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
|
||||
Reference in new issue
Block a user