mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 18:18:43 +00:00
fix(setup): persist setup_completed flag to prevent repeated first-time notice
After running ccs setup with local proxy mode, the CLI was still showing the first-time install notice because isFirstTimeInstall() only checked for user-created content (profiles, accounts, variants, etc.). When user chose "Local" mode and skipped API profiles, config had empty objects, causing all checks to return false. Added setup_completed flag to UnifiedConfig interface and set it to true when setup wizard completes. isFirstTimeInstall() now checks this flag first.
This commit is contained in:
@@ -132,6 +132,11 @@ export function isFirstTimeInstall(): boolean {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If setup wizard was completed, NOT first-time install
|
||||||
|
if (loaded.setup_completed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check for any meaningful configuration in unified config
|
// Check for any meaningful configuration in unified config
|
||||||
const hasProfiles = Object.keys(loaded.profiles || {}).length > 0;
|
const hasProfiles = Object.keys(loaded.profiles || {}).length > 0;
|
||||||
const hasAccounts = Object.keys(loaded.accounts || {}).length > 0;
|
const hasAccounts = Object.keys(loaded.accounts || {}).length > 0;
|
||||||
@@ -370,6 +375,7 @@ async function runSetupWizard(force: boolean = false): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save config
|
// Save config
|
||||||
|
config.setup_completed = true;
|
||||||
saveUnifiedConfig(config);
|
saveUnifiedConfig(config);
|
||||||
|
|
||||||
// Final summary
|
// Final summary
|
||||||
|
|||||||
@@ -521,6 +521,8 @@ export const DEFAULT_DASHBOARD_AUTH_CONFIG: DashboardAuthConfig = {
|
|||||||
export interface UnifiedConfig {
|
export interface UnifiedConfig {
|
||||||
/** Config version (7 for quota management) */
|
/** Config version (7 for quota management) */
|
||||||
version: number;
|
version: number;
|
||||||
|
/** Flag indicating setup wizard has been completed */
|
||||||
|
setup_completed?: boolean;
|
||||||
/** Default profile name to use when none specified */
|
/** Default profile name to use when none specified */
|
||||||
default?: string;
|
default?: string;
|
||||||
/** Account-based profiles (isolated Claude instances) */
|
/** Account-based profiles (isolated Claude instances) */
|
||||||
|
|||||||
Reference in New Issue
Block a user