mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37: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;
|
||||
|
||||
setting.options = {};
|
||||
for (let regionName in SERVER_REGIONS) {
|
||||
const region = SERVER_REGIONS[regionName];
|
||||
@ -10789,6 +10790,10 @@ function setupSettingsUi() {
|
||||
if (region.isDefault) {
|
||||
label += ` (${t('default')})`;
|
||||
value = 'default';
|
||||
|
||||
if (selectedValue === regionName) {
|
||||
selectedValue = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
setting.options[value] = label;
|
||||
@ -10798,9 +10803,11 @@ function setupSettingsUi() {
|
||||
const label = setting.options[value];
|
||||
|
||||
const $option = CE('option', {value: value}, label);
|
||||
$option.selected = value === selectedValue || label.includes(selectedValue);
|
||||
$control.appendChild($option);
|
||||
}
|
||||
|
||||
// Select preferred region
|
||||
$control.value = selectedValue;
|
||||
} else {
|
||||
if (settingId === Preferences.BETTER_XCLOUD_LOCALE) {
|
||||
$control = PREFS.toElement(settingId, e => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user