mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
remove unknown user option check
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user