remove unknown user option check

This commit is contained in:
end-4
2025-02-04 23:50:21 +01:00
parent 90a4afc328
commit 9323b0685c
@@ -236,29 +236,17 @@ let configOptions = {
}
// Override defaults with user's options
let optionsOkay = true;
function overrideConfigRecursive(userOverrides, configOptions = {}, check = true) {
function overrideConfigRecursive(userOverrides, configOptions = {}) {
for (const [key, value] of Object.entries(userOverrides)) {
if (!check) {
if (typeof value === 'object' && !(value instanceof Array)) {
overrideConfigRecursive(value, configOptions[key]);
}
else {
configOptions[key] = value;
continue;
}
if (configOptions[key] === undefined && check) {
optionsOkay = false;
}
else if (typeof value === 'object' && !(value instanceof Array)) {
if (key === "substitutions" || key === "regexSubstitutions" || key === "extraGptModels") {
overrideConfigRecursive(value, configOptions[key], false);
} else overrideConfigRecursive(value, configOptions[key]);
}
}
}
overrideConfigRecursive(userOverrides, configOptions);
if (!optionsOkay) Utils.timeout(2000, () => Utils.execAsync(['notify-send',
'Update your user options',
'One or more config options don\'t exist',
'-a', 'ags',
]).catch(print))
globalThis['userOptions'] = configOptions;
export default configOptions;