forked from Shinonome/dots-hyprland
remove unknown user option check
This commit is contained in:
@@ -236,29 +236,17 @@ let configOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Override defaults with user's options
|
// Override defaults with user's options
|
||||||
let optionsOkay = true;
|
function overrideConfigRecursive(userOverrides, configOptions = {}) {
|
||||||
function overrideConfigRecursive(userOverrides, configOptions = {}, check = true) {
|
|
||||||
for (const [key, value] of Object.entries(userOverrides)) {
|
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;
|
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);
|
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;
|
globalThis['userOptions'] = configOptions;
|
||||||
export default configOptions;
|
export default configOptions;
|
||||||
|
|||||||
Reference in New Issue
Block a user