From 15272fb47ebb594d2d089e5f04fc24cf0d5f4af7 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:33:19 -0500 Subject: [PATCH] fix(config): properly save global_prep_cmd and fps (#2192) --- src_assets/common/assets/web/config.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index e9d866dd..b90ab7ed 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -1408,12 +1408,20 @@ this.tabs.forEach(tab => { Object.keys(tab.options).forEach(optionKey => { let delete_value = false - if (optionKey === "global_prep_cmd" || optionKey === "resolutions" || optionKey === "fps") { - let regex = /([\d]+x[\d]+)/g // this regex is only needed for resolutions - // Use a regular expression to find each value and replace it with a quoted version - let config_value = JSON.parse(config[optionKey].replace(regex, '"$1"')).toString() - let default_value = JSON.parse(tab.options[optionKey].replace(regex, '"$1"')).toString() + if (["resolutions", "fps", "global_prep_cmd"].includes(optionKey)) { + let config_value, default_value + + if (optionKey === "resolutions") { + let regex = /([\d]+x[\d]+)/g + + // Use a regular expression to find each value and replace it with a quoted version + config_value = JSON.parse(config[optionKey].replace(regex, '"$1"')).toString() + default_value = JSON.parse(tab.options[optionKey].replace(regex, '"$1"')).toString() + } else { + config_value = JSON.parse(config[optionKey]) + default_value = JSON.parse(tab.options[optionKey]) + } if (config_value === default_value) { delete_value = true