change factory reset flow
This commit is contained in:
parent
0f6f0da6d5
commit
d2a23a2c45
10
src/Main.tsx
10
src/Main.tsx
|
@ -273,6 +273,14 @@ const Main = () => {
|
||||||
setStep(Step.Discovery);
|
setStep(Step.Discovery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cancelFactoryReset = () => {
|
||||||
|
if (walletKey.current) {
|
||||||
|
setStep(Step.Home);
|
||||||
|
} else {
|
||||||
|
setStep(Step.Discovery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const pinDisplayCounter = () => {
|
const pinDisplayCounter = () => {
|
||||||
return pinCounter == PIN_MAX_RETRY ? -1 : pinCounter;
|
return pinCounter == PIN_MAX_RETRY ? -1 : pinCounter;
|
||||||
}
|
}
|
||||||
|
@ -294,7 +302,7 @@ const Main = () => {
|
||||||
{step == Step.LoadSuccess && <InfoScreen icon="check-circle" title="Congratulations!" message="You've successfully protected your wallet. Remember to keep your seed phrase safe, it's your responsibility!" onPressFunc={toHome}></InfoScreen>}
|
{step == Step.LoadSuccess && <InfoScreen icon="check-circle" title="Congratulations!" message="You've successfully protected your wallet. Remember to keep your seed phrase safe, it's your responsibility!" onPressFunc={toHome}></InfoScreen>}
|
||||||
{step == Step.Authentication && <Dialpad pinRetryCounter={pinDisplayCounter()} prompt={"Enter PIN"} onCancelFunc={cancel} onNextFunc={authenticate}></Dialpad>}
|
{step == Step.Authentication && <Dialpad pinRetryCounter={pinDisplayCounter()} prompt={"Enter PIN"} onCancelFunc={cancel} onNextFunc={authenticate}></Dialpad>}
|
||||||
{step == Step.Home && <HomeScreen pinRequired={pinRef.current ? false : true} pinRetryCounter={pinDisplayCounter()} walletKey={walletKey.current} onPressFunc={login} onCancelFunc={cancel} onFactoryResetFunc={startFactoryReset}></HomeScreen>}
|
{step == Step.Home && <HomeScreen pinRequired={pinRef.current ? false : true} pinRetryCounter={pinDisplayCounter()} walletKey={walletKey.current} onPressFunc={login} onCancelFunc={cancel} onFactoryResetFunc={startFactoryReset}></HomeScreen>}
|
||||||
{step == Step.FactoryReset && <FactoryResetScreen pinRetryCounter={pinDisplayCounter()} onPressFunc={connectCard} onCancelFunc={cancel}></FactoryResetScreen>}
|
{step == Step.FactoryReset && <FactoryResetScreen pinRetryCounter={pinDisplayCounter()} onPressFunc={connectCard} onCancelFunc={cancelFactoryReset}></FactoryResetScreen>}
|
||||||
<NFCModal isVisible={isModalVisible} onChangeFunc={stopNFC}></NFCModal>
|
<NFCModal isVisible={isModalVisible} onChangeFunc={stopNFC}></NFCModal>
|
||||||
</ImageBackground>
|
</ImageBackground>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue