Skip to content

Commit

Permalink
rework the function
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed May 7, 2024
1 parent 2581344 commit c970341
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function BaseModal(
*/
const hideModal = useCallback(
(callHideCallback = true) => {
if (Modal.getModalVisibleCount() === 0) {
if (Modal.areAllModalsHidden()) {
Modal.willAlertModalBecomeVisible(false);
if (shouldSetModalVisibility) {
Modal.setModalVisibility(false);
Expand Down
6 changes: 3 additions & 3 deletions src/libs/actions/Modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function willAlertModalBecomeVisible(isVisible: boolean, isPopover = false) {
Onyx.merge(ONYXKEYS.MODAL, {willAlertModalBecomeVisible: isVisible, isPopover});
}

function getModalVisibleCount() {
return closeModals.length;
function areAllModalsHidden() {
return closeModals.length === 0;
}

export {setCloseModal, close, onModalDidClose, setModalVisibility, willAlertModalBecomeVisible, setDisableDismissOnEscape, closeTop, getModalVisibleCount};
export {setCloseModal, close, onModalDidClose, setModalVisibility, willAlertModalBecomeVisible, setDisableDismissOnEscape, closeTop, areAllModalsHidden};

0 comments on commit c970341

Please sign in to comment.