diff --git a/.config/ags/modules/.configuration/user_options.js b/.config/ags/modules/.configuration/user_options.js index 608cbe04f..e8096f852 100644 --- a/.config/ags/modules/.configuration/user_options.js +++ b/.config/ags/modules/.configuration/user_options.js @@ -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;