mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 04:18:05 +00:00
fix(config): persist setup_completed flag to YAML file
Critical fix: setup_completed was set in memory but never written to disk. - Add setup_completed to generateYamlWithComments() for YAML serialization - Add setup_completed to mergeWithDefaults() to preserve during config merge Without these changes, the flag was lost on save/reload, causing first-time notice to reappear. Addresses critical code review feedback on PR #372.
This commit is contained in:
@@ -139,6 +139,7 @@ function mergeWithDefaults(partial: Partial<UnifiedConfig>): UnifiedConfig {
|
||||
const defaults = createEmptyUnifiedConfig();
|
||||
return {
|
||||
version: partial.version ?? defaults.version,
|
||||
setup_completed: partial.setup_completed,
|
||||
default: partial.default ?? defaults.default,
|
||||
accounts: partial.accounts ?? defaults.accounts,
|
||||
profiles: partial.profiles ?? defaults.profiles,
|
||||
@@ -326,6 +327,9 @@ function generateYamlWithComments(config: UnifiedConfig): string {
|
||||
|
||||
// Version
|
||||
lines.push(`version: ${config.version}`);
|
||||
if (config.setup_completed !== undefined) {
|
||||
lines.push(`setup_completed: ${config.setup_completed}`);
|
||||
}
|
||||
lines.push('');
|
||||
|
||||
// Default
|
||||
|
||||
Reference in New Issue
Block a user