fix(config): properly save global_prep_cmd and fps (#2192)
This commit is contained in:
parent
a0d5973799
commit
15272fb47e
1 changed files with 13 additions and 5 deletions
|
|
@ -1408,12 +1408,20 @@
|
||||||
this.tabs.forEach(tab => {
|
this.tabs.forEach(tab => {
|
||||||
Object.keys(tab.options).forEach(optionKey => {
|
Object.keys(tab.options).forEach(optionKey => {
|
||||||
let delete_value = false
|
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()
|
if (["resolutions", "fps", "global_prep_cmd"].includes(optionKey)) {
|
||||||
let default_value = JSON.parse(tab.options[optionKey].replace(regex, '"$1"')).toString()
|
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) {
|
if (config_value === default_value) {
|
||||||
delete_value = true
|
delete_value = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue