From 9323b0685c5f4a554b331f090f19f8e7d17fb466 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 4 Feb 2025 23:50:21 +0100 Subject: [PATCH] remove unknown user option check --- .../modules/.configuration/user_options.js | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) 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;