/
githubmirror
/
ChatDev
Обзор
Документация
Войти
/
githubmirror
/
ChatDev
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
frontend/src/utils/configStore.js
21 строка
625 B
YunLong
feat: Add comprehensive i18n support and fix WorkflowEdge crash bug
01 апр 2026, 13:54
01 апр 2026, 13:54
37aaf31
Код
Авторство
О чём код?
import { reactive, watch } from 'vue' const CONFIG_KEY = 'agent_config_settings' const defaultSettings = { AUTO_SHOW_ADVANCED: false, AUTO_EXPAND_MESSAGES: false, ENABLE_HELP_TOOLTIPS: true, LANGUAGE: 'en' } // Initialize state from localStorage const stored = localStorage.getItem(CONFIG_KEY) const initialState = stored ? { ...defaultSettings, ...JSON.parse(stored) } : { ...defaultSettings } export const configStore = reactive(initialState) // Watch for changes and save to localStorage watch(configStore, (newVal) => { localStorage.setItem(CONFIG_KEY, JSON.stringify(newVal)) }, { deep: true })