From 3452bd6babef05d7d97bdde7b5f4bdd3f5c7e254 Mon Sep 17 00:00:00 2001 From: wo-o29 Date: Fri, 17 Oct 2025 11:19:56 +0900 Subject: [PATCH] refactor: simplify ADD action logic by removing dead code --- packages/src/context/reducer.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/src/context/reducer.ts b/packages/src/context/reducer.ts index 3c111ab..2f2fcb0 100644 --- a/packages/src/context/reducer.ts +++ b/packages/src/context/reducer.ts @@ -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, @@ -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': {