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 '../../modules/actions/initial';
|
||||||
import { pick } from '../../util/iteratees';
|
import { pick } from '../../util/iteratees';
|
||||||
import { PLATFORM_ENV } from '../../util/environment';
|
import { PLATFORM_ENV } from '../../util/environment';
|
||||||
|
import windowSize from '../../util/windowSize';
|
||||||
import useHistoryBack from '../../hooks/useHistoryBack';
|
import useHistoryBack from '../../hooks/useHistoryBack';
|
||||||
|
|
||||||
import UiLoader from '../common/UiLoader';
|
import UiLoader from '../common/UiLoader';
|
||||||
@ -43,6 +44,15 @@ const Auth: FC<StateProps & DispatchProps> = ({
|
|||||||
|| (isMobile && authState === 'authorizationStateWaitQrCode'), handleChangeAuthorizationMethod,
|
|| (isMobile && authState === 'authorizationStateWaitQrCode'), handleChangeAuthorizationMethod,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Prevent refresh when rotating device
|
||||||
|
useEffect(() => {
|
||||||
|
windowSize.disableRefresh();
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
windowSize.enableRefresh();
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
switch (authState) {
|
switch (authState) {
|
||||||
case 'authorizationStateWaitCode':
|
case 'authorizationStateWaitCode':
|
||||||
return <UiLoader page="authCode" key="authCode"><AuthCode /></UiLoader>;
|
return <UiLoader page="authCode" key="authCode"><AuthCode /></UiLoader>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user