Revert "feat(settings): add auto-launch on system startup feature"
This reverts commit ba336fc416.
Reason: Found issues that need to be addressed before reintroducing
the auto-launch feature. Will reimplement with fixes.
This commit is contained in:
@@ -19,13 +19,6 @@ export function WindowSettings({ settings, onChange }: WindowSettingsProps) {
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<ToggleRow
|
||||
title={t("settings.launchOnStartup")}
|
||||
description={t("settings.launchOnStartupDescription")}
|
||||
checked={!!settings.launchOnStartup}
|
||||
onCheckedChange={(value) => onChange({ launchOnStartup: value })}
|
||||
/>
|
||||
|
||||
<ToggleRow
|
||||
title={t("settings.minimizeToTray")}
|
||||
description={t("settings.minimizeToTrayDescription")}
|
||||
|
||||
@@ -126,7 +126,6 @@ export function useSettings(): UseSettingsResult {
|
||||
const previousClaudeDir = sanitizeDir(data?.claudeConfigDir);
|
||||
const previousCodexDir = sanitizeDir(data?.codexConfigDir);
|
||||
const previousGeminiDir = sanitizeDir(data?.geminiConfigDir);
|
||||
const previousAutoLaunch = data?.launchOnStartup ?? false;
|
||||
|
||||
const payload: Settings = {
|
||||
...settings,
|
||||
@@ -140,20 +139,6 @@ export function useSettings(): UseSettingsResult {
|
||||
|
||||
await settingsApi.setAppConfigDirOverride(sanitizedAppDir ?? null);
|
||||
|
||||
// 如果开机自启状态改变,调用系统 API
|
||||
if (payload.launchOnStartup !== previousAutoLaunch) {
|
||||
try {
|
||||
await settingsApi.setAutoLaunch(payload.launchOnStartup);
|
||||
} catch (error) {
|
||||
console.error("Failed to update auto-launch:", error);
|
||||
toast.error(
|
||||
t("settings.autoLaunchFailed", {
|
||||
defaultValue: "设置开机自启失败",
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (payload.enableClaudePluginIntegration) {
|
||||
await settingsApi.applyClaudePluginConfig({ official: false });
|
||||
|
||||
@@ -82,7 +82,6 @@ export function useSettingsForm(): UseSettingsFormResult {
|
||||
minimizeToTrayOnClose: data.minimizeToTrayOnClose ?? true,
|
||||
enableClaudePluginIntegration:
|
||||
data.enableClaudePluginIntegration ?? false,
|
||||
launchOnStartup: data.launchOnStartup ?? false,
|
||||
claudeConfigDir: sanitizeDir(data.claudeConfigDir),
|
||||
codexConfigDir: sanitizeDir(data.codexConfigDir),
|
||||
language: normalizedLanguage,
|
||||
@@ -102,7 +101,6 @@ export function useSettingsForm(): UseSettingsFormResult {
|
||||
showInTray: true,
|
||||
minimizeToTrayOnClose: true,
|
||||
enableClaudePluginIntegration: false,
|
||||
launchOnStartup: false,
|
||||
language: readPersistedLanguage(),
|
||||
} as SettingsFormState);
|
||||
|
||||
@@ -137,7 +135,6 @@ export function useSettingsForm(): UseSettingsFormResult {
|
||||
minimizeToTrayOnClose: serverData.minimizeToTrayOnClose ?? true,
|
||||
enableClaudePluginIntegration:
|
||||
serverData.enableClaudePluginIntegration ?? false,
|
||||
launchOnStartup: serverData.launchOnStartup ?? false,
|
||||
claudeConfigDir: sanitizeDir(serverData.claudeConfigDir),
|
||||
codexConfigDir: sanitizeDir(serverData.codexConfigDir),
|
||||
language: normalizedLanguage,
|
||||
|
||||
@@ -166,9 +166,6 @@
|
||||
"languageOptionEnglish": "English",
|
||||
"windowBehavior": "Window Behavior",
|
||||
"windowBehaviorHint": "Configure window minimize and Claude plugin integration policies.",
|
||||
"launchOnStartup": "Launch on Startup",
|
||||
"launchOnStartupDescription": "Automatically run CC Switch when system starts",
|
||||
"autoLaunchFailed": "Failed to set auto-launch",
|
||||
"minimizeToTray": "Minimize to tray on close",
|
||||
"minimizeToTrayDescription": "When checked, clicking the close button will hide to system tray, otherwise the app will exit directly.",
|
||||
"enableClaudePluginIntegration": "Apply to Claude Code extension",
|
||||
|
||||
@@ -166,9 +166,6 @@
|
||||
"languageOptionEnglish": "English",
|
||||
"windowBehavior": "窗口行为",
|
||||
"windowBehaviorHint": "配置窗口最小化与 Claude 插件联动策略。",
|
||||
"launchOnStartup": "开机自启",
|
||||
"launchOnStartupDescription": "随系统启动自动运行 CC Switch",
|
||||
"autoLaunchFailed": "设置开机自启失败",
|
||||
"minimizeToTray": "关闭时最小化到托盘",
|
||||
"minimizeToTrayDescription": "勾选后点击关闭按钮会隐藏到系统托盘,取消则直接退出应用。",
|
||||
"enableClaudePluginIntegration": "应用到 Claude Code 插件",
|
||||
|
||||
@@ -107,12 +107,4 @@ export const settingsApi = {
|
||||
}
|
||||
await invoke("open_external", { url });
|
||||
},
|
||||
|
||||
async setAutoLaunch(enabled: boolean): Promise<boolean> {
|
||||
return await invoke("set_auto_launch", { enabled });
|
||||
},
|
||||
|
||||
async getAutoLaunchStatus(): Promise<boolean> {
|
||||
return await invoke("get_auto_launch_status");
|
||||
},
|
||||
};
|
||||
|
||||
@@ -101,8 +101,6 @@ export interface Settings {
|
||||
geminiConfigDir?: string;
|
||||
// 首选语言(可选,默认中文)
|
||||
language?: "en" | "zh";
|
||||
// 是否开机自启
|
||||
launchOnStartup?: boolean;
|
||||
// Claude 自定义端点列表
|
||||
customEndpointsClaude?: Record<string, CustomEndpoint>;
|
||||
// Codex 自定义端点列表
|
||||
|
||||
Reference in New Issue
Block a user