Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opex",
"version": "v1.0.11-beta.20",
"version": "v1.0.12-beta.21",
"homepage": "",
"private": true,
"dependencies": {
Expand Down
27 changes: 26 additions & 1 deletion src/main/Browser/Pages/Login/components/LoginForm/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ import {getUserConfigsInitiate, setUserInfo, setUserTokensInitiate} from "../../
import {useGetKycStatus} from "../../../../../../queries";
import {login, parseToken} from "js-api-client";
import Icon from "../../../../../../components/Icon/Icon";
import EmailVerification from "../EmailVerification/EmailVerification";

const LoginForm = () => {
const {t} = useTranslation();
const navigate = useNavigate();
const dispatch = useDispatch();
const location = useLocation();

const verifyEmailLock = useSelector((state) => state.exchange.verifyEmailLock)

const isDevelopment = window.env.REACT_APP_ENV === "development";
const [isInputVisible, setIsInputVisible] = useState(false);
const [isLoading, setLoading] = useState(false);
Expand All @@ -31,13 +34,21 @@ const LoginForm = () => {
const [credential, setCredential] = useState({username: "", password: "", otp: ""});
const {refetch: getKycStatus} = useGetKycStatus();

const [verifyEmail, setVerifyEmail] = useState(false);
const [showVerifyEmail, setShowVerifyEmail] = useState(false);
const [disable, setDisable] = useState(false);

const from = location.state?.from?.pathname || "/";

const agent = [deviceType, browserName, fullBrowserVersion]
const clientSecret = window.env.REACT_APP_CLIENT_SECRET
const clientId = window.env.REACT_APP_CLIENT_ID


useEffect(() => {
if (verifyEmailLock && new Date().getTime() < verifyEmailLock) setDisable(true)
}, [verifyEmailLock]);

useEffect(() => {
setNeedOTP(undefined)
}, [credential.username])
Expand Down Expand Up @@ -86,6 +97,7 @@ const LoginForm = () => {
return setNeedOTP(true)
}
if (err?.response?.status === 400 && err?.response?.data?.error_description === "Account is not fully set up") {
setShowVerifyEmail(true)
return setLoginError(t("login.accountNotActive"));
}
setLoginError(t("login.loginError"));
Expand All @@ -97,6 +109,9 @@ const LoginForm = () => {

if (isLoading) return <LoginFormLoading/>

if (verifyEmail) return <EmailVerification returnFunc={() => setVerifyEmail(false)} email={credential.username} disable={disable} returnFuncDisableFalse={() => setDisable(false)} returnFuncDisableTrue={() => setDisable(true)}/>


const setOTPInputHandler = (val) => {
setCredential({...credential, otp: val})
}
Expand Down Expand Up @@ -142,11 +157,21 @@ const LoginForm = () => {
<div className={`column ${classes.forgetPassword}`}>
<span className={`${classes.errorText} fs-0-8`}>{loginError}</span>


{needOTP ?
<span className="cursor-pointer flex ai-center fs-0-8"
onClick={returnToLogin}>{t('login.back')}</span>
:
<div className="flex ai-center mt-2"><span className={`cursor-pointer fs-0-8 hover-text`} onClick={() => setForgetPassword(true)}>{t('login.forgetPassword')}</span></div>
<div className="flex ai-center mt-2">

{
showVerifyEmail ?
<span className={`cursor-pointer fs-0-8 hover-text`} onClick={() => setVerifyEmail(true)}>{t('login.verificationEmail')}</span>
:
<span className={`cursor-pointer fs-0-8 hover-text`} onClick={() => setForgetPassword(true)}>{t('login.forgetPassword')}</span>
}

</div>
}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ const SellOrder = () => {
maxDecimal={activePair.quoteAssetPrecision}
after={t("currency." + activePair.quoteAsset)}
onchange={(e) => sellPriceHandler(e.target.value, "totalPrice")}
alert={alert.totalPrice}
isAllowed={isAllowed}
/>

Expand Down
17 changes: 10 additions & 7 deletions src/store/sagas/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,16 @@ export function* loadConfig(action) {
}

const assetsScope = {
TBTC: {min: 0.000001, step: 0.000001},
BTC: {min: 0.000001, step: 0.000001},
TETH: {min: 0.00001, step: 0.00001},
ETH: {min: 0.00001, step: 0.00001},
TBNB: {min: 0.001, step: 0.001},
BNB: {min: 0.001, step: 0.001},
TBTC: {min: 0.0000001, step: 0.0000001},
BTC: {min: 0.0000001, step: 0.0000001},
TETH: {min: 0.0000001, step: 0.0000001},
ETH: {min: 0.0000001, step: 0.0000001},
TBNB: {min: 0.00001, step: 0.00001},
BNB: {min: 0.00001, step: 0.00001},
USDT: {min: 0.01, step: 0.01},
IRT: {min: 50000, step: 1000},
TRX: {min: 0.1, step: 0.1},
TRX: {min: 0.0000001, step: 0.0000001},
SOL: {min: 0.000001, step: 0.000001},
TON: {min: 0.00001, step: 0.00001},
DOGE: {min: 0.00001, step: 0.00001},
}