Voice Chat: Prevent accidentally rotating device
This commit is contained in:
parent
5621d4dc9d
commit
8be450cc35
@ -24,12 +24,13 @@ import { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck'
|
|||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
import { fastRaf } from '../../util/schedulers';
|
import { fastRaf } from '../../util/schedulers';
|
||||||
import { waitForTransitionEnd } from '../../util/cssAnimationEndListeners';
|
import { waitForTransitionEnd } from '../../util/cssAnimationEndListeners';
|
||||||
|
import { processDeepLink } from '../../util/deeplink';
|
||||||
|
import windowSize from '../../util/windowSize';
|
||||||
import useShowTransition from '../../hooks/useShowTransition';
|
import useShowTransition from '../../hooks/useShowTransition';
|
||||||
import useBackgroundMode from '../../hooks/useBackgroundMode';
|
import useBackgroundMode from '../../hooks/useBackgroundMode';
|
||||||
import useBeforeUnload from '../../hooks/useBeforeUnload';
|
import useBeforeUnload from '../../hooks/useBeforeUnload';
|
||||||
import useOnChange from '../../hooks/useOnChange';
|
import useOnChange from '../../hooks/useOnChange';
|
||||||
import usePreventPinchZoomGesture from '../../hooks/usePreventPinchZoomGesture';
|
import usePreventPinchZoomGesture from '../../hooks/usePreventPinchZoomGesture';
|
||||||
import { processDeepLink } from '../../util/deeplink';
|
|
||||||
import { LOCATION_HASH } from '../../hooks/useHistoryBack';
|
import { LOCATION_HASH } from '../../hooks/useHistoryBack';
|
||||||
|
|
||||||
import LeftColumn from '../left/LeftColumn';
|
import LeftColumn from '../left/LeftColumn';
|
||||||
@ -167,6 +168,19 @@ const Main: FC<StateProps & DispatchProps> = ({
|
|||||||
}
|
}
|
||||||
}, [lastSyncTime]);
|
}, [lastSyncTime]);
|
||||||
|
|
||||||
|
// Prevent refresh by accidentally rotating device when listening to a voice chat
|
||||||
|
useEffect(() => {
|
||||||
|
if (!activeGroupCallId) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
windowSize.disableRefresh();
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
windowSize.enableRefresh();
|
||||||
|
};
|
||||||
|
}, [activeGroupCallId]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
transitionClassNames: middleColumnTransitionClassNames,
|
transitionClassNames: middleColumnTransitionClassNames,
|
||||||
} = useShowTransition(!isLeftColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);
|
} = useShowTransition(!isLeftColumnShown, undefined, true, undefined, shouldSkipHistoryAnimations);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user