message-verify 1.0.1-beta.34 → 1.0.1-beta.35

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.
package/dist/main.js CHANGED
@@ -44,6 +44,8 @@ createRoot(document.getElementById('root')).render(_jsxs(_Fragment, { children:
44
44
  apiReject: () => {
45
45
  },
46
46
  apiResolve: () => {
47
+ },
48
+ apiPromiseToEmpty: () => {
47
49
  }
48
50
  }), children: "Show verify Modal" }), _jsx("button", { onClick: () => createReLoginModal({
49
51
  goLogin: () => {
@@ -21,6 +21,7 @@ export type ModalConfig = {
21
21
  api?: string;
22
22
  apiReject: any;
23
23
  apiResolve: any;
24
+ apiPromiseToEmpty: () => void;
24
25
  };
25
26
  export type LoginModalConfig = {
26
27
  goLogin: () => void;
@@ -11,7 +11,7 @@ const CreateMessageVerifyModal = ({ props }) => {
11
11
  const [captchaImage, setCaptchaImage] = useState('');
12
12
  const [captchCode, setCaptchCode] = useState('');
13
13
  const [captchaKey, setCaptchaKey] = useState('');
14
- const { data, http, lang, api = '/admin/sms/send', config, apiResolve, apiReject } = props || {};
14
+ const { data, http, lang, api = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty } = props || {};
15
15
  const dataObj = JSON.parse(data || '{}');
16
16
  const { mobile, verifyCodeKey } = dataObj || {};
17
17
  const getKey = async () => {
@@ -64,7 +64,7 @@ const CreateMessageVerifyModal = ({ props }) => {
64
64
  };
65
65
  return (_jsxs(Modal, { width: 420, visible: visible, onClose: () => {
66
66
  setVisible(false);
67
- apiReject();
67
+ apiPromiseToEmpty();
68
68
  props.onClose?.();
69
69
  }, children: [_jsx("div", { style: { fontSize: 14, color: '#666' }, children: t('alreadySend', lang, { phone: mobile }) }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8, marginTop: 12 }, children: [_jsx(Input.OTP, { length: 6, value: otp, onChange: async (val) => {
70
70
  setOtp(val);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.1-beta.34",
3
+ "version": "1.0.1-beta.35",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/main.tsx CHANGED
@@ -48,6 +48,8 @@ createRoot(document.getElementById('root')!).render(
48
48
  apiReject: () => {
49
49
  },
50
50
  apiResolve: () => {
51
+ },
52
+ apiPromiseToEmpty: () => {
51
53
  }
52
54
  })}>
53
55
  Show verify Modal
package/src/utils/type.ts CHANGED
@@ -22,6 +22,7 @@ export type ModalConfig = {
22
22
  api?: string;
23
23
  apiReject: any;
24
24
  apiResolve: any;
25
+ apiPromiseToEmpty: () => void;
25
26
  }
26
27
 
27
28
  export type LoginModalConfig = {
@@ -12,7 +12,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
12
12
  const [captchaImage, setCaptchaImage] = useState<string>('');
13
13
  const [captchCode, setCaptchCode] = useState<string>('');
14
14
  const [captchaKey, setCaptchaKey] = useState<string>('');
15
- const { data, http, lang, api = '/admin/sms/send', config, apiResolve, apiReject } = props || {};
15
+ const { data, http, lang, api = '/admin/sms/send', config, apiResolve, apiPromiseToEmpty } = props || {};
16
16
  const dataObj = JSON.parse(data || '{}');
17
17
  const { mobile, verifyCodeKey } = dataObj || {};
18
18
 
@@ -72,7 +72,7 @@ const CreateMessageVerifyModal = ({ props }: { props: ModalConfig }) => {
72
72
  visible={visible}
73
73
  onClose={() => {
74
74
  setVisible(false);
75
- apiReject();
75
+ apiPromiseToEmpty();
76
76
  props.onClose?.();
77
77
  }}
78
78
  >