mirror of
https://github.com/mempool/mempool.git
synced 2025-01-01 03:04:27 +01:00
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:
commit
df63117088
@ -247,10 +247,10 @@ export class DashboardComponent implements OnInit {
|
|||||||
|
|
||||||
setLanguageFromUrl() {
|
setLanguageFromUrl() {
|
||||||
const urlLanguage = this.document.location.pathname.split('/')[1];
|
const urlLanguage = this.document.location.pathname.split('/')[1];
|
||||||
if (urlLanguage === '') {
|
if (this.languages.map((lang) => lang.code).indexOf(urlLanguage) > -1) {
|
||||||
this.languageForm.get('language').setValue('en');
|
|
||||||
} else if (this.languages.map((lang) => lang.code).indexOf(urlLanguage) > -1) {
|
|
||||||
this.languageForm.get('language').setValue(urlLanguage);
|
this.languageForm.get('language').setValue(urlLanguage);
|
||||||
|
} else {
|
||||||
|
this.languageForm.get('language').setValue('en');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user