Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 2 additions & 5 deletions src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ function BaseModal(
shouldPreventScrollOnFocus = false,
enableEdgeToEdgeBottomSafeAreaPadding,
shouldApplySidePanelOffset = type === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED,
canBeClosedByOtherModal = true,
}: BaseModalProps,
ref: React.ForwardedRef<View>,
) {
Expand Down Expand Up @@ -140,9 +139,7 @@ function BaseModal(
if (isVisible) {
willAlertModalBecomeVisible(true, type === CONST.MODAL.MODAL_TYPE.POPOVER || type === CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED);
// To handle closing any modal already visible when this modal is mounted, i.e. PopoverReportActionContextMenu
if (canBeClosedByOtherModal) {
removeOnCloseListener = setCloseModal(onClose);
}
removeOnCloseListener = setCloseModal(onClose);
}

return () => {
Expand All @@ -151,7 +148,7 @@ function BaseModal(
}
removeOnCloseListener();
};
}, [isVisible, wasVisible, onClose, type, canBeClosedByOtherModal]);
}, [isVisible, wasVisible, onClose, type]);

useEffect(() => {
hideModalCallbackRef.current = hideModal;
Expand Down
5 changes: 0 additions & 5 deletions src/components/Modal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ type BaseModalProps = Partial<ReactNativeModalProps> &
* This is used to adjust the modal position when the Side Panel is open.
*/
shouldApplySidePanelOffset?: boolean;

/**
* Whether the modal can be closed by other modals
*/
canBeClosedByOtherModal?: boolean;
};

export default BaseModalProps;
Expand Down
8 changes: 2 additions & 6 deletions src/components/TestToolsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const modalContentMaxHeightPercentage = 0.75;

function TestToolsModal() {
const {shouldUseNarrowLayout} = useResponsiveLayout();
const [isTestToolsModalOpen = false] = useOnyx(ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN);
const [shouldStoreLogs = false] = useOnyx(ONYXKEYS.SHOULD_STORE_LOGS);
const [isTestToolsModalOpen = false] = useOnyx(ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN, {canBeMissing: true});
const [shouldStoreLogs = false] = useOnyx(ONYXKEYS.SHOULD_STORE_LOGS, {canBeMissing: true});
const {windowWidth, windowHeight} = useWindowDimensions();
const StyleUtils = useStyleUtils();
const styles = useThemeStyles();
Expand All @@ -38,10 +38,6 @@ function TestToolsModal() {
const isAuthenticated = useIsAuthenticated();
const route = getRouteBasedOnAuthStatus(isAuthenticated, activeRoute);

if (!isTestToolsModalOpen) {
return null;
}

return (
<Modal
isVisible={!!isTestToolsModalOpen}
Expand Down
1 change: 0 additions & 1 deletion src/components/ValidateCodeActionModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ function ValidateCodeActionModal({
useNativeDriver
shouldUseModalPaddingStyle={false}
animationInTiming={disableAnimation ? 1 : undefined}
canBeClosedByOtherModal={false}
>
<ScreenWrapper
includeSafeAreaPaddingBottom
Expand Down
Loading