mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-07 18:38:42 +00:00
feat(config): avoid updating blank fields
This commit is contained in:
@ -55,11 +55,15 @@ export const updateConfig = (config: RecursivePartial<Config>) => {
|
||||
|
||||
if (currentConfig[key] && typeof currentConfig[key] === 'object') {
|
||||
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];
|
||||
}
|
||||
}
|
||||
} else if (currentConfig[key] && !config[key]) {
|
||||
} else if (currentConfig[key] && !config[key] && config[key] !== '') {
|
||||
config[key] = currentConfig[key];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user