From 4dc8351f56416832f156e7e67f548810fc8e4960 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 17:50:34 +0900 Subject: [PATCH] Optimize booting script --- src/client/app/boot.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/app/boot.js b/src/client/app/boot.js index f14cebe7d..25aa26dd1 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -18,6 +18,8 @@ return; } + const langs = LANGS; + //#region Load settings let settings = null; const vuex = localStorage.getItem('vuex'); @@ -40,10 +42,10 @@ //#region Detect the user language let lang = null; - if (LANGS.includes(navigator.language)) { + if (langs.includes(navigator.language)) { lang = navigator.language; } else { - lang = LANGS.find(x => x.split('-')[0] == navigator.language); + lang = langs.find(x => x.split('-')[0] == navigator.language); if (lang == null) { // Fallback @@ -52,7 +54,7 @@ } if (settings && settings.device.lang && - LANGS.includes(settings.device.lang)) { + langs.includes(settings.device.lang)) { lang = settings.device.lang; } //#endregion