feat(config): avoid updating blank fields
This commit is contained in:
parent
b2b1d724ee
commit
7653eaf146
|
@ -55,11 +55,15 @@ export const updateConfig = (config: RecursivePartial<Config>) => {
|
||||||
|
|
||||||
if (currentConfig[key] && typeof currentConfig[key] === 'object') {
|
if (currentConfig[key] && typeof currentConfig[key] === 'object') {
|
||||||
for (const nestedKey in currentConfig[key]) {
|
for (const nestedKey in currentConfig[key]) {
|
||||||
if (currentConfig[key][nestedKey] && !config[key][nestedKey]) {
|
if (
|
||||||
|
currentConfig[key][nestedKey] &&
|
||||||
|
!config[key][nestedKey] &&
|
||||||
|
config[key][nestedKey] !== ''
|
||||||
|
) {
|
||||||
config[key][nestedKey] = currentConfig[key][nestedKey];
|
config[key][nestedKey] = currentConfig[key][nestedKey];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (currentConfig[key] && !config[key]) {
|
} else if (currentConfig[key] && !config[key] && config[key] !== '') {
|
||||||
config[key] = currentConfig[key];
|
config[key] = currentConfig[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue