From de5081699040a3330a7ebda2b0baf275d12ca462 Mon Sep 17 00:00:00 2001 From: wiz Date: Tue, 22 Dec 2020 06:41:56 +0900 Subject: [PATCH] Always set a value for the locale selector, for /liquid/ etc. --- frontend/src/app/dashboard/dashboard.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index 132a8a24b..6e419712e 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -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'); } }