From 1b0f46b4bd516d0703f6fb97411378a71a8f692d Mon Sep 17 00:00:00 2001 From: Dharmesh Date: Tue, 9 Sep 2025 22:47:19 +0530 Subject: [PATCH 1/2] fixed action settings save issue --- .../store/config/action/settings/action-settings.slice.ts | 7 +++---- .../acf-options-page/src/store/config/watch/watch.slice.ts | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts b/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts index d1dd3058..e7895f12 100644 --- a/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts +++ b/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts @@ -13,7 +13,7 @@ export interface IActionSettingsStore { export interface IActionSettingsRequest { name: string; - value: boolean | string | number; + value: boolean; } const initialState: IActionSettingsStore = { @@ -27,9 +27,8 @@ const slice = createSlice({ reducers: { updateActionSettings: (state, action: PayloadAction) => { const { name, value } = action.payload; - if (name in state.settings) { - (state.settings as Record)[name] = value; - } + // @ts-expect-error "making is generic function difficult for TypeScript" + state.settings[name] = value; }, switchActionSettingsModal: (state) => { window.dataLayer.push({ event: 'modal', name: 'action_settings', visibility: !state.visible }); diff --git a/apps/acf-options-page/src/store/config/watch/watch.slice.ts b/apps/acf-options-page/src/store/config/watch/watch.slice.ts index a9b37223..9b6d377b 100644 --- a/apps/acf-options-page/src/store/config/watch/watch.slice.ts +++ b/apps/acf-options-page/src/store/config/watch/watch.slice.ts @@ -27,9 +27,8 @@ const slice = createSlice({ reducers: { updateWatch: (state, action: PayloadAction) => { const { name, value } = action.payload; - if (name in state.watch) { - (state.watch as Record)[name] = value; - } + // @ts-expect-error "making is generic function difficult for TypeScript" + state.watch[name] = value; }, updateWatchLifecycleStopConditions: (state, action: PayloadAction) => { const { name, value } = action.payload; From 747aa9be63835b3348f6800d8cafc4276c88144f Mon Sep 17 00:00:00 2001 From: Dharmesh Date: Tue, 9 Sep 2025 22:49:23 +0530 Subject: [PATCH 2/2] added additional prop types --- .../src/store/config/action/settings/action-settings.slice.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts b/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts index e7895f12..3aa3046a 100644 --- a/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts +++ b/apps/acf-options-page/src/store/config/action/settings/action-settings.slice.ts @@ -13,7 +13,7 @@ export interface IActionSettingsStore { export interface IActionSettingsRequest { name: string; - value: boolean; + value: boolean | string | number; } const initialState: IActionSettingsStore = {