diff --git a/native/media/camera-modal.react.js b/native/media/camera-modal.react.js --- a/native/media/camera-modal.react.js +++ b/native/media/camera-modal.react.js @@ -247,6 +247,7 @@ +dispatch: Dispatch, // withOverlayContext +overlayContext: ?OverlayContextType, + +isActive: boolean, }; type State = { +zoom: number, @@ -506,35 +507,7 @@ ); } - static isActive(props: Props): boolean { - const { overlayContext } = props; - if (!overlayContext) { - return true; - } - return !overlayContext.isDismissing; - } - - componentDidMount() { - if (CameraModal.isActive(this.props)) { - Orientation.unlockAllOrientations(); - } - } - - componentWillUnmount() { - if (CameraModal.isActive(this.props)) { - Orientation.lockToPortrait(); - } - } - componentDidUpdate(prevProps: Props, prevState: State) { - const isActive = CameraModal.isActive(this.props); - const wasActive = CameraModal.isActive(prevProps); - if (isActive && !wasActive) { - Orientation.unlockAllOrientations(); - } else if (!isActive && wasActive) { - Orientation.lockToPortrait(); - } - if (!this.state.hasCamerasOnBothSides && prevState.hasCamerasOnBothSides) { this.switchCameraButtonX.setValue(-1); this.switchCameraButtonY.setValue(-1); @@ -760,7 +733,7 @@ } render(): React.Node { - const statusBar = CameraModal.isActive(this.props) ? ( + const statusBar = this.props.isActive ? (