diff --git a/packages/pl-fe/src/actions/pl-fe.ts b/packages/pl-fe/src/actions/pl-fe.ts index 1072cd805..96f8c2a6b 100644 --- a/packages/pl-fe/src/actions/pl-fe.ts +++ b/packages/pl-fe/src/actions/pl-fe.ts @@ -2,6 +2,7 @@ import { createSelector } from 'reselect'; import * as v from 'valibot'; import { getHost } from 'pl-fe/actions/instance'; +import { NODE_ENV } from 'pl-fe/build-config'; import { plFeConfigSchema } from 'pl-fe/normalizers/pl-fe/pl-fe-config'; import KVStore from 'pl-fe/storage/kv-store'; import { useSettingsStore } from 'pl-fe/stores/settings'; @@ -39,9 +40,10 @@ const fetchPlFeConfig = (host: string | null) => if (features.frontendConfigurations) { return dispatch(fetchFrontendConfigurations()).then(data => { - if (data.pl_fe) { - dispatch(importPlFeConfig(data.pl_fe, host)); - return data.pl_fe; + const key = NODE_ENV === 'production' ? 'pl_fe' : 'pl_fe_dev'; + if (data[key]) { + dispatch(importPlFeConfig(data[key], host)); + return data[key]; } else { return dispatch(fetchPlFeJson(host)); } diff --git a/packages/pl-fe/src/actions/settings.ts b/packages/pl-fe/src/actions/settings.ts index ac870418f..ee2e36883 100644 --- a/packages/pl-fe/src/actions/settings.ts +++ b/packages/pl-fe/src/actions/settings.ts @@ -2,6 +2,7 @@ import { defineMessage } from 'react-intl'; import { patchMe } from 'pl-fe/actions/me'; import { getClient } from 'pl-fe/api'; +import { NODE_ENV } from 'pl-fe/build-config'; import messages from 'pl-fe/messages'; import { makeGetAccount } from 'pl-fe/selectors'; import KVStore from 'pl-fe/storage/kv-store'; @@ -11,7 +12,7 @@ import { isLoggedIn } from 'pl-fe/utils/auth'; import type { AppDispatch, RootState } from 'pl-fe/store'; -const FE_NAME = 'pl_fe'; +const FE_NAME = NODE_ENV === 'production' ? 'pl_fe' : 'pl_fe_dev'; /** Options when changing/saving settings. */ type SettingOpts = {