@huma-finance/widgets 0.0.61-beta.544 → 0.0.61-beta.546

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/index.js CHANGED
@@ -6251,8 +6251,8 @@ var STATE = /*#__PURE__*/function (STATE) {
6251
6251
  STATE["SignIn"] = "SignIn";
6252
6252
  STATE["Congrats"] = "Congrats";
6253
6253
  return STATE;
6254
- }(STATE || {});
6255
- const ERROR_MESSAGE = 'Failed to update wallet points. Be assured that your points will be added later.';
6254
+ }(STATE || {}); // const ERROR_MESSAGE =
6255
+ // 'Failed to update wallet points. Be assured that your points will be added later.'
6256
6256
  function PointsEarned(_ref) {
6257
6257
  let {
6258
6258
  transactionHash,
@@ -6271,61 +6271,84 @@ function PointsEarned(_ref) {
6271
6271
  const hasPointsAccumulated = !isEmpty(pointsAccumulated) && pointsAccumulated > 0;
6272
6272
  const lockupMonths = Math.round(lpConfig.withdrawalLockoutPeriodInDays / 30);
6273
6273
  const monthText = lockupMonths > 1 ? "".concat(lockupMonths, " months") : "".concat(lockupMonths, " month");
6274
- const {
6275
- errorType,
6276
- setError: setAuthError,
6277
- isWalletOwnershipVerified,
6278
- isWalletOwnershipVerificationRequired
6279
- } = useAuthErrorHandling(isDev);
6280
- const [walletOwnership, setWalletOwnership] = useState();
6274
+
6275
+ // const {
6276
+ // errorType,
6277
+ // setError: setAuthError,
6278
+ // isWalletOwnershipVerified,
6279
+ // isWalletOwnershipVerificationRequired,
6280
+ // } = useAuthErrorHandling(isDev)
6281
+ // const [walletOwnership, setWalletOwnership] = useState<boolean | undefined>()
6281
6282
  const [state, setState] = useState(STATE.Loading);
6282
- useEffect(() => {
6283
- if (isWalletOwnershipVerificationRequired) {
6284
- setState(STATE.Loading);
6285
- }
6286
- }, [isWalletOwnershipVerificationRequired]);
6287
- useEffect(() => {
6288
- if (isWalletOwnershipVerified) {
6289
- setWalletOwnership(true);
6290
- }
6291
- }, [isWalletOwnershipVerified]);
6292
- useEffect(() => {
6293
- const checkWalletOwnership = async () => {
6294
- const ownership = await CampaignService.checkWalletOwnership(account, isDev, pointsTestnetExperience);
6295
- setWalletOwnership(ownership);
6296
- if (!ownership) {
6297
- setAuthError('WalletNotSignInException');
6298
- }
6299
- };
6300
- checkWalletOwnership();
6301
- }, [account, isDev, pointsTestnetExperience, setAuthError]);
6302
- useEffect(() => {
6303
- if (errorType === 'NotSignedIn') {
6304
- setState(STATE.SignIn);
6305
- } else if (errorType === 'UserRejected') {
6306
- dispatch(setError({
6307
- errorMessage: 'User has rejected the transaction.'
6308
- }));
6309
- } else if (errorType === 'Other') {
6310
- dispatch(setError({
6311
- errorMessage: ERROR_MESSAGE
6312
- }));
6313
- }
6314
- }, [dispatch, errorType]);
6283
+
6284
+ // useEffect(() => {
6285
+ // if (isWalletOwnershipVerificationRequired) {
6286
+ // setState(STATE.Loading)
6287
+ // }
6288
+ // }, [isWalletOwnershipVerificationRequired])
6289
+
6290
+ // useEffect(() => {
6291
+ // if (isWalletOwnershipVerified) {
6292
+ // setWalletOwnership(true)
6293
+ // }
6294
+ // }, [isWalletOwnershipVerified])
6295
+
6296
+ // useEffect(() => {
6297
+ // const checkWalletOwnership = async () => {
6298
+ // const ownership = await CampaignService.checkWalletOwnership(
6299
+ // account!,
6300
+ // isDev,
6301
+ // pointsTestnetExperience,
6302
+ // )
6303
+ // setWalletOwnership(ownership)
6304
+ // if (!ownership) {
6305
+ // setAuthError('WalletNotSignInException')
6306
+ // }
6307
+ // }
6308
+ // checkWalletOwnership()
6309
+ // }, [account, isDev, pointsTestnetExperience, setAuthError])
6310
+
6311
+ // useEffect(() => {
6312
+ // if (errorType === 'NotSignedIn') {
6313
+ // setState(STATE.SignIn)
6314
+ // } else if (errorType === 'UserRejected') {
6315
+ // dispatch(
6316
+ // setError({
6317
+ // errorMessage: 'User has rejected the transaction.',
6318
+ // }),
6319
+ // )
6320
+ // } else if (errorType === 'Other') {
6321
+ // dispatch(
6322
+ // setError({
6323
+ // errorMessage: ERROR_MESSAGE,
6324
+ // }),
6325
+ // )
6326
+ // }
6327
+ // }, [dispatch, errorType])
6328
+
6315
6329
  useEffect(() => {
6316
6330
  const updateWalletPoints = async () => {
6317
- if (walletOwnership) {
6318
- try {
6319
- const result = await CampaignService.updateWalletPoints(account, transactionHash, chainId, isDev, pointsTestnetExperience);
6320
- setPointsAccumulated(result.pointsAccumulated);
6321
- setState(STATE.Congrats);
6322
- } catch (error) {
6323
- console.error('Failed to update wallet points', error);
6324
- }
6331
+ // if (walletOwnership) {
6332
+ try {
6333
+ // const result = await CampaignService.updateWalletPoints(
6334
+ // account!,
6335
+ // transactionHash,
6336
+ // chainId!,
6337
+ // isDev,
6338
+ // pointsTestnetExperience,
6339
+ // )
6340
+ // setPointsAccumulated(result.pointsAccumulated)
6341
+ setPointsAccumulated(5000);
6342
+ setState(STATE.Congrats);
6343
+ } catch (error) {
6344
+ console.error('Failed to update wallet points', error);
6325
6345
  }
6346
+ // }
6326
6347
  };
6327
6348
  updateWalletPoints();
6328
- }, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash, walletOwnership]);
6349
+ }, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash
6350
+ // walletOwnership,
6351
+ ]);
6329
6352
  const styles = {
6330
6353
  wrapper: css(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n height: 518px;\n position: relative;\n "]))),
6331
6354
  congrats: css(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n margin: ", ";\n "])), theme.spacing(-4, -4.5, 0, -4.5)),