mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-06 04:36:23 +08:00
feat(settings): add first-run confirmation dialogs for proxy and usage features
Prevent accidental activation of advanced features by showing a one-time info dialog. Once confirmed, the flag is persisted in settings.json and the dialog never appears again. - Proxy: confirmation when toggling proxy server ON for the first time - Usage: confirmation when enabling usage query inside UsageScriptModal - Enhanced ConfirmDialog with "info" variant (blue icon + default button) - Added i18n translations for zh, en, ja
This commit is contained in:
@@ -190,6 +190,12 @@ pub struct AppSettings {
|
||||
/// 是否在主页面启用本地代理功能(默认关闭)
|
||||
#[serde(default)]
|
||||
pub enable_local_proxy: bool,
|
||||
/// User has confirmed the local proxy first-run notice
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub proxy_confirmed: Option<bool>,
|
||||
/// User has confirmed the usage query first-run notice
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub usage_confirmed: Option<bool>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub language: Option<String>,
|
||||
|
||||
@@ -266,6 +272,8 @@ impl Default for AppSettings {
|
||||
launch_on_startup: false,
|
||||
silent_startup: false,
|
||||
enable_local_proxy: false,
|
||||
proxy_confirmed: None,
|
||||
usage_confirmed: None,
|
||||
language: None,
|
||||
visible_apps: None,
|
||||
claude_config_dir: None,
|
||||
|
||||
Reference in New Issue
Block a user