@matchain/matchid-sdk-react 0.1.37-alpha.10 → 0.1.37-alpha.11

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.
@@ -4,7 +4,7 @@ import {
4
4
  useMatchEvents,
5
5
  useUserInfo,
6
6
  useWallet
7
- } from "../chunk-35YNZM5K.mjs";
7
+ } from "../chunk-HTYFFIQV.mjs";
8
8
  import "../chunk-6PWH7WZI.mjs";
9
9
  import "../chunk-J5LGTIGS.mjs";
10
10
  export {
package/dist/index.js CHANGED
@@ -2037,14 +2037,9 @@ function PasswordModal({
2037
2037
  return "";
2038
2038
  }, [rePassword, password]);
2039
2039
  (0, import_react6.useEffect)(() => {
2040
- if (isOpen && overview) {
2040
+ if (isOpen) {
2041
2041
  setPassword("");
2042
2042
  setRePassword("");
2043
- const did2 = overview.did.split(":")[2];
2044
- initWallet({
2045
- did: did2,
2046
- address: ""
2047
- });
2048
2043
  }
2049
2044
  }, [isOpen, overview]);
2050
2045
  const [isSubmitting, setIsSubmitting] = (0, import_react6.useState)(false);
@@ -2052,8 +2047,13 @@ function PasswordModal({
2052
2047
  if (isSubmitting) return;
2053
2048
  try {
2054
2049
  setIsSubmitting(true);
2050
+ const did2 = overview ? overview.did.split(":")[2] : "";
2051
+ await initWallet({
2052
+ did: did2,
2053
+ address: ""
2054
+ });
2055
2055
  const address = await generateWallet({
2056
- did: did.split(":")[2],
2056
+ did: did2.split(":")[2],
2057
2057
  userPasscode: password
2058
2058
  });
2059
2059
  await refreshOverview();
@@ -2139,11 +2139,6 @@ function RecoveryModal({
2139
2139
  (0, import_react7.useEffect)(() => {
2140
2140
  if (isOpen && overview) {
2141
2141
  setPassword("");
2142
- const did = overview.did.split(":")[2];
2143
- initWallet({
2144
- did,
2145
- address: overview.address
2146
- });
2147
2142
  }
2148
2143
  }, [isOpen, overview]);
2149
2144
  const [isSubmitting, setIsSubmitting] = (0, import_react7.useState)(false);
@@ -2151,6 +2146,11 @@ function RecoveryModal({
2151
2146
  if (isSubmitting) return;
2152
2147
  try {
2153
2148
  setIsSubmitting(true);
2149
+ const did = overview ? overview.did.split(":")[2] : "";
2150
+ await initWallet({
2151
+ did,
2152
+ address: overview?.address || ""
2153
+ });
2154
2154
  await recoveryWallet("ethereum", "user_passcode_recovery_key", password);
2155
2155
  await refreshOverview();
2156
2156
  onSuccess && onSuccess();