Merge remote-tracking branch 'origin/master' into simon/angular-universal

This commit is contained in:
wiz 2020-12-22 07:17:40 +09:00
commit 51ed2a1f31
No known key found for this signature in database
GPG Key ID: A394E332255A6173

View File

@ -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');
} }
} }