@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.
@@ -6291,8 +6291,8 @@ var STATE = /*#__PURE__*/function (STATE) {
6291
6291
  STATE["SignIn"] = "SignIn";
6292
6292
  STATE["Congrats"] = "Congrats";
6293
6293
  return STATE;
6294
- }(STATE || {});
6295
- const ERROR_MESSAGE = 'Failed to update wallet points. Be assured that your points will be added later.';
6294
+ }(STATE || {}); // const ERROR_MESSAGE =
6295
+ // 'Failed to update wallet points. Be assured that your points will be added later.'
6296
6296
  function PointsEarned(_ref) {
6297
6297
  let {
6298
6298
  transactionHash,
@@ -6311,61 +6311,84 @@ function PointsEarned(_ref) {
6311
6311
  const hasPointsAccumulated = !shared.isEmpty(pointsAccumulated) && pointsAccumulated > 0;
6312
6312
  const lockupMonths = Math.round(lpConfig.withdrawalLockoutPeriodInDays / 30);
6313
6313
  const monthText = lockupMonths > 1 ? "".concat(lockupMonths, " months") : "".concat(lockupMonths, " month");
6314
- const {
6315
- errorType,
6316
- setError: setAuthError,
6317
- isWalletOwnershipVerified,
6318
- isWalletOwnershipVerificationRequired
6319
- } = webShared.useAuthErrorHandling(isDev);
6320
- const [walletOwnership, setWalletOwnership] = React.useState();
6314
+
6315
+ // const {
6316
+ // errorType,
6317
+ // setError: setAuthError,
6318
+ // isWalletOwnershipVerified,
6319
+ // isWalletOwnershipVerificationRequired,
6320
+ // } = useAuthErrorHandling(isDev)
6321
+ // const [walletOwnership, setWalletOwnership] = useState<boolean | undefined>()
6321
6322
  const [state, setState] = React.useState(STATE.Loading);
6322
- React.useEffect(() => {
6323
- if (isWalletOwnershipVerificationRequired) {
6324
- setState(STATE.Loading);
6325
- }
6326
- }, [isWalletOwnershipVerificationRequired]);
6327
- React.useEffect(() => {
6328
- if (isWalletOwnershipVerified) {
6329
- setWalletOwnership(true);
6330
- }
6331
- }, [isWalletOwnershipVerified]);
6332
- React.useEffect(() => {
6333
- const checkWalletOwnership = async () => {
6334
- const ownership = await shared.CampaignService.checkWalletOwnership(account, isDev, pointsTestnetExperience);
6335
- setWalletOwnership(ownership);
6336
- if (!ownership) {
6337
- setAuthError('WalletNotSignInException');
6338
- }
6339
- };
6340
- checkWalletOwnership();
6341
- }, [account, isDev, pointsTestnetExperience, setAuthError]);
6342
- React.useEffect(() => {
6343
- if (errorType === 'NotSignedIn') {
6344
- setState(STATE.SignIn);
6345
- } else if (errorType === 'UserRejected') {
6346
- dispatch(setError({
6347
- errorMessage: 'User has rejected the transaction.'
6348
- }));
6349
- } else if (errorType === 'Other') {
6350
- dispatch(setError({
6351
- errorMessage: ERROR_MESSAGE
6352
- }));
6353
- }
6354
- }, [dispatch, errorType]);
6323
+
6324
+ // useEffect(() => {
6325
+ // if (isWalletOwnershipVerificationRequired) {
6326
+ // setState(STATE.Loading)
6327
+ // }
6328
+ // }, [isWalletOwnershipVerificationRequired])
6329
+
6330
+ // useEffect(() => {
6331
+ // if (isWalletOwnershipVerified) {
6332
+ // setWalletOwnership(true)
6333
+ // }
6334
+ // }, [isWalletOwnershipVerified])
6335
+
6336
+ // useEffect(() => {
6337
+ // const checkWalletOwnership = async () => {
6338
+ // const ownership = await CampaignService.checkWalletOwnership(
6339
+ // account!,
6340
+ // isDev,
6341
+ // pointsTestnetExperience,
6342
+ // )
6343
+ // setWalletOwnership(ownership)
6344
+ // if (!ownership) {
6345
+ // setAuthError('WalletNotSignInException')
6346
+ // }
6347
+ // }
6348
+ // checkWalletOwnership()
6349
+ // }, [account, isDev, pointsTestnetExperience, setAuthError])
6350
+
6351
+ // useEffect(() => {
6352
+ // if (errorType === 'NotSignedIn') {
6353
+ // setState(STATE.SignIn)
6354
+ // } else if (errorType === 'UserRejected') {
6355
+ // dispatch(
6356
+ // setError({
6357
+ // errorMessage: 'User has rejected the transaction.',
6358
+ // }),
6359
+ // )
6360
+ // } else if (errorType === 'Other') {
6361
+ // dispatch(
6362
+ // setError({
6363
+ // errorMessage: ERROR_MESSAGE,
6364
+ // }),
6365
+ // )
6366
+ // }
6367
+ // }, [dispatch, errorType])
6368
+
6355
6369
  React.useEffect(() => {
6356
6370
  const updateWalletPoints = async () => {
6357
- if (walletOwnership) {
6358
- try {
6359
- const result = await shared.CampaignService.updateWalletPoints(account, transactionHash, chainId, isDev, pointsTestnetExperience);
6360
- setPointsAccumulated(result.pointsAccumulated);
6361
- setState(STATE.Congrats);
6362
- } catch (error) {
6363
- console.error('Failed to update wallet points', error);
6364
- }
6371
+ // if (walletOwnership) {
6372
+ try {
6373
+ // const result = await CampaignService.updateWalletPoints(
6374
+ // account!,
6375
+ // transactionHash,
6376
+ // chainId!,
6377
+ // isDev,
6378
+ // pointsTestnetExperience,
6379
+ // )
6380
+ // setPointsAccumulated(result.pointsAccumulated)
6381
+ setPointsAccumulated(5000);
6382
+ setState(STATE.Congrats);
6383
+ } catch (error) {
6384
+ console.error('Failed to update wallet points', error);
6365
6385
  }
6386
+ // }
6366
6387
  };
6367
6388
  updateWalletPoints();
6368
- }, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash, walletOwnership]);
6389
+ }, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash
6390
+ // walletOwnership,
6391
+ ]);
6369
6392
  const styles = {
6370
6393
  wrapper: material.css(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n height: 518px;\n position: relative;\n "]))),
6371
6394
  congrats: material.css(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n margin: ", ";\n "])), theme.spacing(-4, -4.5, 0, -4.5)),