if the report or add to studio modals are open, don't switch to fulls… ()

* if the report or add to studio modals are open, don't switch to fullscreen on orientationchange landscape

* fix linting errors
This commit is contained in:
Linda 2018-10-05 18:00:52 -04:00 committed by Benjamin Wheeler
parent 79afc55f26
commit 14741e1cb8

View file

@ -124,7 +124,8 @@ class Preview extends React.Component {
* landscape format should make the fullscreen mode active
*/
const isMobileDevice = screen.height <= frameless.mobile || screen.width <= frameless.mobile;
if (this.props.playerMode && isMobileDevice) {
const isAModalOpen = this.state.addToStudioOpen || this.state.reportOpen;
if (this.props.playerMode && isMobileDevice && !isAModalOpen) {
const isLandscape = screen.height < screen.width;
if (isLandscape) {
this.props.setFullScreen(true);