From 246cc5b7c74254b0e609cc60e76220011edeb58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Erik=20St=C3=B8wer?= Date: Wed, 27 Dec 2023 15:25:49 +0100 Subject: [PATCH] Fix environment config --- src/config/readConfig.js | 4 ++-- src/localization/localization.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/readConfig.js b/src/config/readConfig.js index 049b173a8..795365aeb 100644 --- a/src/config/readConfig.js +++ b/src/config/readConfig.js @@ -13,14 +13,14 @@ See the Licence for the specific language governing permissions and limitations under the Licence. */ import { getEnvironment } from "./getEnvironment"; -const globalConfig = require("./global.json"); +import globalConfig from "./global.json"; var configreader = {}; configreader.readConfig = (callback) => { const fetchEnvConfig = async () => { const env = getEnvironment(); - const { default: config } = await import(`./environments/${env}.json`); + const config = await import(`./environments/${env}.json`); callback(Object.assign({}, globalConfig, config)); }; fetchEnvConfig(); diff --git a/src/localization/localization.js b/src/localization/localization.js index cb245af64..75d9b98db 100644 --- a/src/localization/localization.js +++ b/src/localization/localization.js @@ -16,7 +16,7 @@ const localization = async (locale) => { const localStorageKey = "ABZU::settings::locale"; const preferredLocale = locale || localStorage.getItem(localStorageKey) || "en"; - const { default: messages } = await import( + const messages = await import( `../static/lang/${preferredLocale}.json` ); localStorage.setItem(localStorageKey, preferredLocale);