Skip to content
Open
Changes from all commits
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
15 changes: 4 additions & 11 deletions packages/src/context/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ export function overlayReducer(state: OverlayData, action: OverlayReducerAction)
if (state.overlayData[action.overlay.id] != null && state.overlayData[action.overlay.id].isOpen === false) {
const overlay = state.overlayData[action.overlay.id];

// ignore if the overlay don't exist or already open
if (overlay == null || overlay.isOpen) {
return state;
}

return {
...state,
current: action.overlay.id,
Expand All @@ -96,12 +91,10 @@ export function overlayReducer(state: OverlayData, action: OverlayReducerAction)
* @description Brings the overlay to the front when reopened after closing without unmounting.
*/
overlayOrderList: [...state.overlayOrderList.filter((item) => item !== action.overlay.id), action.overlay.id],
overlayData: isExisted
? state.overlayData
: {
...state.overlayData,
[action.overlay.id]: action.overlay,
},
overlayData: {
...state.overlayData,
[action.overlay.id]: action.overlay,
},
};
}
case 'OPEN': {
Expand Down