From 21180c28ff0a791ea8370a9b25f71ce5d71e8728 Mon Sep 17 00:00:00 2001 From: yougotwill Date: Tue, 6 Aug 2024 14:50:40 +1000 Subject: [PATCH] fix: simplify getIsModalVisable Selector --- ts/state/selectors/modal.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ts/state/selectors/modal.ts b/ts/state/selectors/modal.ts index a1896f736..04054402c 100644 --- a/ts/state/selectors/modal.ts +++ b/ts/state/selectors/modal.ts @@ -29,15 +29,13 @@ export const getModal = (state: StateType): ModalState => { export const getIsModalVisble = createSelector(getModal, (state: ModalState): boolean => { const modalValues = Object.values(state); - let visible = false; for (let i = 0; i < modalValues.length; i++) { if (modalValues[i] !== null) { - visible = true; - break; + return true; } } - return visible; + return false; }); export const getConfirmModal = createSelector(