Commit 5768ebe3 by Nguyễn Thị Thúy

merge func_smart_otp

parent 06185bad
...@@ -43,12 +43,10 @@ const EnterPasswordSmartOTP = (props) => { ...@@ -43,12 +43,10 @@ const EnterPasswordSmartOTP = (props) => {
}); });
if (res.data.code == 200) { if (res.data.code == 200) {
navigation.navigate(CHANGESMARTOTP, {old_password: pinCode}); navigation.navigate(CHANGESMARTOTP, {old_password: pinCode});
clearPIN()
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
setFirstNumber(null); clearPIN()
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
} }
} else { } else {
const res = await getOTPApiSmartOTP({ const res = await getOTPApiSmartOTP({
...@@ -65,14 +63,17 @@ const EnterPasswordSmartOTP = (props) => { ...@@ -65,14 +63,17 @@ const EnterPasswordSmartOTP = (props) => {
props.route.params.onGoToSmartOTP(pinCode, res.data.data.otp); props.route.params.onGoToSmartOTP(pinCode, res.data.data.otp);
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
setFirstNumber(null); clearPIN()
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
} }
} }
props.hideLoading(); props.hideLoading();
}; };
const clearPIN = () => {
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
}
const onDeletePress = () => { const onDeletePress = () => {
if (fourNumber) { if (fourNumber) {
setFourNumber(null); setFourNumber(null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment