@matchain/matchid-sdk-react 0.1.51-alpha.2 → 0.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ import {
12
12
  useTransaction,
13
13
  useUserInfo,
14
14
  useWallet
15
- } from "../chunk-OWEJPD4R.mjs";
15
+ } from "../chunk-VIJ4FUT3.mjs";
16
16
  import "../chunk-UA6XHZHX.mjs";
17
17
  import "../chunk-HLUFAIFV.mjs";
18
18
  import {
package/dist/index.js CHANGED
@@ -2051,11 +2051,11 @@ function useUserInfo() {
2051
2051
  };
2052
2052
  const getLoginEmailCode = async (email) => {
2053
2053
  const res = await getEmailCodeApi(email);
2054
- if (res && res.data && isSuccess(res)) {
2054
+ if (isSuccess(res)) {
2055
2055
  window.sessionStorage.setItem("loginkey", res.data.key);
2056
2056
  return res.data.key;
2057
2057
  }
2058
- return "";
2058
+ throw new Error(res.message);
2059
2059
  };
2060
2060
  const loginByEmail = async ({
2061
2061
  email,
@@ -3440,8 +3440,8 @@ function StepVerify(props) {
3440
3440
  try {
3441
3441
  setError("");
3442
3442
  setSending(true);
3443
- sendTimeRef.current = intervalTime;
3444
3443
  await getLoginEmailCode(props.email);
3444
+ sendTimeRef.current = intervalTime;
3445
3445
  setSendBtnText(`${sendTimeRef.current}s`);
3446
3446
  intervalRef.current = setInterval(() => {
3447
3447
  sendTimeRef.current--;