Merge pull request #274 from mempool/wiz/fix-locale-selector-default-value

Always set a value for the locale selector, for /liquid/ etc.
This commit is contained in:
softsimon 2020-12-22 05:06:24 +07:00 committed by GitHub
commit df63117088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,10 +247,10 @@ export class DashboardComponent implements OnInit {
setLanguageFromUrl() {
const urlLanguage = this.document.location.pathname.split('/')[1];
if (urlLanguage === '') {
this.languageForm.get('language').setValue('en');
} else if (this.languages.map((lang) => lang.code).indexOf(urlLanguage) > -1) {
if (this.languages.map((lang) => lang.code).indexOf(urlLanguage) > -1) {
this.languageForm.get('language').setValue(urlLanguage);
} else {
this.languageForm.get('language').setValue('en');
}
}