{t('settings.general.nonEssentialTrafficDescription')}
+ +{t('settings.general.notificationsDescription')}
diff --git a/desktop/src/stores/settingsStore.test.ts b/desktop/src/stores/settingsStore.test.ts index 2f61d47d..14d2330b 100644 --- a/desktop/src/stores/settingsStore.test.ts +++ b/desktop/src/stores/settingsStore.test.ts @@ -132,6 +132,14 @@ describe('settingsStore locale defaults', () => { expect(window.localStorage.getItem('cc-haha-locale')).toBe('kr') }) + it('defaults to blocking non-essential traffic (disabled=true)', async () => { + mockSystemLanguages(['en-US']) + + const { useSettingsStore } = await import('./settingsStore') + + expect(useSettingsStore.getState().nonEssentialTrafficDisabled).toBe(true) + }) + it('applies a locale event from another desktop window', async () => { mockSystemLanguages(['en-US']) let emitLocale: ((locale: Locale) => void) | undefined diff --git a/desktop/src/stores/settingsStore.ts b/desktop/src/stores/settingsStore.ts index fb2e8616..4dfea0d6 100644 --- a/desktop/src/stores/settingsStore.ts +++ b/desktop/src/stores/settingsStore.ts @@ -4,6 +4,7 @@ import { settingsApi } from '../api/settings' import { modelsApi } from '../api/models' import { h5AccessApi } from '../api/h5Access' import { tracesApi } from '../api/traces' +import { privacyApi } from '../api/privacy' import { type AppMode, type AppModeConfig, @@ -77,6 +78,8 @@ type SettingsStore = { updateProxy: UpdateProxySettings network: NetworkSettings traceCapture: TraceCaptureSettings + /** true = 禁用非必要外部流量(遥测/更新检查/官方注册表等,默认开启) */ + nonEssentialTrafficDisabled: boolean h5Access: H5AccessSettings h5AccessDiagnostics: H5AccessDiagnostics | null h5AccessError: string | null @@ -108,6 +111,7 @@ type SettingsStore = { setUpdateProxy: (settings: UpdateProxySettings) => Promise