fix: simplify getIsModalVisable Selector

pull/3137/head
yougotwill 9 months ago
parent 935175120a
commit 21180c28ff

@ -29,15 +29,13 @@ export const getModal = (state: StateType): ModalState => {
export const getIsModalVisble = createSelector(getModal, (state: ModalState): boolean => { export const getIsModalVisble = createSelector(getModal, (state: ModalState): boolean => {
const modalValues = Object.values(state); const modalValues = Object.values(state);
let visible = false;
for (let i = 0; i < modalValues.length; i++) { for (let i = 0; i < modalValues.length; i++) {
if (modalValues[i] !== null) { if (modalValues[i] !== null) {
visible = true; return true;
break;
} }
} }
return visible; return false;
}); });
export const getConfirmModal = createSelector( export const getConfirmModal = createSelector(

Loading…
Cancel
Save