Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit ea88cc3

Browse files
committed
fix: Windows reducer hook
1 parent ee5d33e commit ea88cc3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

common/packages/package/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export type TabIconParam = {
1515

1616
export type WindowsReducerParam = {
1717

18-
reducedState: IWindow[];
1918
state: IWindow[];
2019
action: WindowsActions;
2120
}

ui/contexts/WindowsContext.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ const WindowsProvider: FC<Props> = ({ children }: Props): ReactElement => {
2929

3030
const reducer = (state: IWindow[], action: WindowsActions): IWindow[] => {
3131

32-
const reducedState = windowsReducer(state, action);
33-
34-
return callTrigger('hookWindowsReducer', {
35-
reducedState,
32+
const hookState = callTrigger('hookWindowsReducer', {
3633
state,
3734
action,
3835
}).state;
36+
37+
return windowsReducer(hookState, action);
3938
}
4039

4140
const [windows, dispatch] = useReducer<Reducer<IWindow[], WindowsActions>>(reducer, defaultState.windows);

0 commit comments

Comments
 (0)