mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Fix region selection box not selecting correct value
This commit is contained in:
parent
37d0a0c6e2
commit
b27f84b980
@ -10780,6 +10780,7 @@ function setupSettingsUi() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
selectedValue = PREF_PREFERRED_REGION;
|
selectedValue = PREF_PREFERRED_REGION;
|
||||||
|
|
||||||
setting.options = {};
|
setting.options = {};
|
||||||
for (let regionName in SERVER_REGIONS) {
|
for (let regionName in SERVER_REGIONS) {
|
||||||
const region = SERVER_REGIONS[regionName];
|
const region = SERVER_REGIONS[regionName];
|
||||||
@ -10789,6 +10790,10 @@ function setupSettingsUi() {
|
|||||||
if (region.isDefault) {
|
if (region.isDefault) {
|
||||||
label += ` (${t('default')})`;
|
label += ` (${t('default')})`;
|
||||||
value = 'default';
|
value = 'default';
|
||||||
|
|
||||||
|
if (selectedValue === regionName) {
|
||||||
|
selectedValue = 'default';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setting.options[value] = label;
|
setting.options[value] = label;
|
||||||
@ -10798,9 +10803,11 @@ function setupSettingsUi() {
|
|||||||
const label = setting.options[value];
|
const label = setting.options[value];
|
||||||
|
|
||||||
const $option = CE('option', {value: value}, label);
|
const $option = CE('option', {value: value}, label);
|
||||||
$option.selected = value === selectedValue || label.includes(selectedValue);
|
|
||||||
$control.appendChild($option);
|
$control.appendChild($option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select preferred region
|
||||||
|
$control.value = selectedValue;
|
||||||
} else {
|
} else {
|
||||||
if (settingId === Preferences.BETTER_XCLOUD_LOCALE) {
|
if (settingId === Preferences.BETTER_XCLOUD_LOCALE) {
|
||||||
$control = PREFS.toElement(settingId, e => {
|
$control = PREFS.toElement(settingId, e => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user