mirror of https://github.com/status-im/codimd.git
Fix logical error in legacy config expression
We should check for an undefined and not just for a logical true or false. Example: When `usecdn` was set to false it was impossible to overwrite the new config value because the if statement becomes false. Thanks @davidmehren for pointing me to this issue. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
4eef661c15
commit
10a81e7db2
|
@ -110,8 +110,8 @@ for (let i = keys.length; i--;) {
|
||||||
// and the config with uppercase is not set
|
// and the config with uppercase is not set
|
||||||
// we set the new config using the old key.
|
// we set the new config using the old key.
|
||||||
if (uppercase.test(keys[i]) &&
|
if (uppercase.test(keys[i]) &&
|
||||||
config[lowercaseKey] &&
|
config[lowercaseKey] !== undefined &&
|
||||||
!config[keys[1]]) {
|
fileConfig[keys[i]] === undefined) {
|
||||||
logger.warn('config.js contains deprecated lowercase setting for ' + keys[i] + '. Please change your config.js file to replace ' + lowercaseKey + ' with ' + keys[i])
|
logger.warn('config.js contains deprecated lowercase setting for ' + keys[i] + '. Please change your config.js file to replace ' + lowercaseKey + ' with ' + keys[i])
|
||||||
config[keys[i]] = config[lowercaseKey]
|
config[keys[i]] = config[lowercaseKey]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue