From a6f5e260a75fc2227bd14c72387c7b3ec29b1298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Fri, 6 Jun 2025 00:13:48 +0200 Subject: [PATCH] pl-fe: use separate settings key for dev env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-fe/src/actions/pl-fe.ts | 8 +++++--- packages/pl-fe/src/actions/settings.ts | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) 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 = {