mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 22:14:22 +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:
1 parent
596a9c6843
commit
a8c46cc8ed
1 file changed
+4
@@ -139,6 +139,7 @@ function mergeWithDefaults(partial: Partial<UnifiedConfig>): UnifiedConfig {
|
|||||||
const defaults = createEmptyUnifiedConfig();
|
const defaults = createEmptyUnifiedConfig();
|
||||||
return {
|
return {
|
||||||
version: partial.version ?? defaults.version,
|
version: partial.version ?? defaults.version,
|
||||||
|
setup_completed: partial.setup_completed,
|
||||||
default: partial.default ?? defaults.default,
|
default: partial.default ?? defaults.default,
|
||||||
accounts: partial.accounts ?? defaults.accounts,
|
accounts: partial.accounts ?? defaults.accounts,
|
||||||
profiles: partial.profiles ?? defaults.profiles,
|
profiles: partial.profiles ?? defaults.profiles,
|
||||||
@@ -326,6 +327,9 @@ function generateYamlWithComments(config: UnifiedConfig): string {
|
|||||||
|
|
||||||
// Version
|
// Version
|
||||||
lines.push(`version: ${config.version}`);
|
lines.push(`version: ${config.version}`);
|
||||||
|
if (config.setup_completed !== undefined) {
|
||||||
|
lines.push(`setup_completed: ${config.setup_completed}`);
|
||||||
|
}
|
||||||
lines.push('');
|
lines.push('');
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
|
|||||||
Reference in new issue
Block a user