Fix potential race condition with locale, most likely fixes #3789
This commit is contained in:
parent
db77e08264
commit
fd93c4d0d4
1 changed files with 6 additions and 1 deletions
|
|
@ -110,7 +110,12 @@ export class ManageUserPreferencesComponent implements OnInit {
|
||||||
get Locale() {
|
get Locale() {
|
||||||
if (!this.settingsForm.get('locale')) return 'English';
|
if (!this.settingsForm.get('locale')) return 'English';
|
||||||
|
|
||||||
return (this.locales || []).filter(l => l.fileName === this.settingsForm.get('locale')!.value)[0].renderName;
|
const locale = (this.locales || []).find(l => l.fileName === this.settingsForm.get('locale')!.value);
|
||||||
|
if (!locale) {
|
||||||
|
return 'English';
|
||||||
|
}
|
||||||
|
|
||||||
|
return locale.renderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue