refac: reactive user settings

This commit is contained in:
Timothy Jaeryang Baek
2025-08-12 03:48:04 +04:00
parent 62506b1955
commit f91da291d9
2 changed files with 87 additions and 61 deletions

View File

@@ -6,7 +6,7 @@
import { getOllamaConfig, updateOllamaConfig } from '$lib/apis/ollama';
import { getOpenAIConfig, updateOpenAIConfig, getOpenAIModels } from '$lib/apis/openai';
import { getModels as _getModels } from '$lib/apis';
import { getModels as _getModels, getBackendConfig } from '$lib/apis';
import { getConnectionsConfig, setConnectionsConfig } from '$lib/apis/configs';
import { config, models, settings, user } from '$lib/stores';
@@ -114,6 +114,7 @@
if (res) {
toast.success($i18n.t('Connections settings updated'));
await models.set(await getModels());
await config.set(await getBackendConfig());
}
};
@@ -198,6 +199,8 @@
updateOllamaHandler();
dispatch('save');
await config.set(await getBackendConfig());
};
</script>