Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface IActionSettingsStore {

export interface IActionSettingsRequest {
name: string;
value: boolean | string | number;
value: boolean;
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the value type from boolean | string | number to just boolean is a breaking change that could cause runtime errors if callers are still passing string or number values. Consider maintaining backward compatibility or ensuring all call sites are updated.

Copilot uses AI. Check for mistakes.

}

const initialState: IActionSettingsStore = {
Expand All @@ -27,9 +27,8 @@ const slice = createSlice({
reducers: {
updateActionSettings: (state, action: PayloadAction<IActionSettingsRequest>) => {
const { name, value } = action.payload;
if (name in state.settings) {
(state.settings as Record<string, typeof value>)[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 });
Expand Down
5 changes: 2 additions & 3 deletions apps/acf-options-page/src/store/config/watch/watch.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ const slice = createSlice({
reducers: {
updateWatch: (state, action: PayloadAction<IWatchUpdateRequest>) => {
const { name, value } = action.payload;
if (name in state.watch) {
(state.watch as Record<string, typeof value>)[name] = value;
}
// @ts-expect-error "making is generic function difficult for TypeScript"
state.watch[name] = value;
},
updateWatchLifecycleStopConditions: (state, action: PayloadAction<IWatchUpdateRequest>) => {
const { name, value } = action.payload;
Expand Down
Loading