mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 04:45:08 +01:00
Auth: Prevent refresh when rotating device
This commit is contained in:
parent
e39a63aa73
commit
10309e44dc
@ -6,6 +6,7 @@ import { GlobalActions, GlobalState } from '../../global/types';
|
||||
import '../../modules/actions/initial';
|
||||
import { pick } from '../../util/iteratees';
|
||||
import { PLATFORM_ENV } from '../../util/environment';
|
||||
import windowSize from '../../util/windowSize';
|
||||
import useHistoryBack from '../../hooks/useHistoryBack';
|
||||
|
||||
import UiLoader from '../common/UiLoader';
|
||||
@ -43,6 +44,15 @@ const Auth: FC<StateProps & DispatchProps> = ({
|
||||
|| (isMobile && authState === 'authorizationStateWaitQrCode'), handleChangeAuthorizationMethod,
|
||||
);
|
||||
|
||||
// Prevent refresh when rotating device
|
||||
useEffect(() => {
|
||||
windowSize.disableRefresh();
|
||||
|
||||
return () => {
|
||||
windowSize.enableRefresh();
|
||||
};
|
||||
}, []);
|
||||
|
||||
switch (authState) {
|
||||
case 'authorizationStateWaitCode':
|
||||
return <UiLoader page="authCode" key="authCode"><AuthCode /></UiLoader>;
|
||||
|
Loading…
Reference in New Issue
Block a user