mobile: fix login 2fa sheet not open inside modal

This commit is contained in:
ammarahm-ed
2023-02-23 16:01:59 +05:00
parent fe8ba8ca90
commit 17e9de7ff9

View File

@@ -83,9 +83,6 @@ export const Login = ({ changeMode }) => {
<>
<ForgotPassword />
<SheetProvider context="two_factor_verify" />
{loading ? (
<BaseDialog transparent={true} visible={true} animation="fade" />
) : null}
<Animated.View
entering={FadeInDown}
exiting={FadeOutUp}
@@ -172,7 +169,7 @@ export const Login = ({ changeMode }) => {
errorMessage="Email is invalid"
placeholder="Enter your email"
defaultValue={email.current}
editable={step === LoginSteps.emailAuth}
editable={step === LoginSteps.emailAuth && !loading}
onSubmit={() => {
passwordInputRef.current?.focus();
}}
@@ -194,6 +191,7 @@ export const Login = ({ changeMode }) => {
autoCorrect={false}
placeholder="Password"
marginBottom={0}
editable={!loading}
defaultValue={password.current}
onSubmit={() => login()}
/>
@@ -205,6 +203,7 @@ export const Login = ({ changeMode }) => {
paddingHorizontal: 0
}}
onPress={() => {
if (loading) return;
SheetManager.show("forgotpassword_sheet", email.current);
}}
textStyle={{
@@ -228,7 +227,10 @@ export const Login = ({ changeMode }) => {
borderRadius: 100
}}
loading={loading}
onPress={login}
onPress={() => {
if (loading) return;
login();
}}
type="accent"
title={
loading
@@ -248,6 +250,7 @@ export const Login = ({ changeMode }) => {
marginTop: 10
}}
onPress={() => {
if (loading) return;
setStep(LoginSteps.emailAuth);
setLoading(false);
}}