@ecency/wallets 1.5.4 → 1.5.5

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.
@@ -1474,6 +1474,9 @@ function useClaimRewards(username, auth, onSuccess) {
1474
1474
  queryClient.invalidateQueries({
1475
1475
  queryKey: getAccountFullQueryOptions(username).queryKey
1476
1476
  });
1477
+ queryClient.invalidateQueries({
1478
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
1479
+ });
1477
1480
  queryClient.invalidateQueries({
1478
1481
  queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1479
1482
  });
@@ -1488,6 +1491,28 @@ function useClaimRewards(username, auth, onSuccess) {
1488
1491
  queryKey: ["ecency-wallets", "asset-info", username, asset]
1489
1492
  });
1490
1493
  });
1494
+ setTimeout(() => {
1495
+ queryClient.invalidateQueries({
1496
+ queryKey: getAccountFullQueryOptions(username).queryKey
1497
+ });
1498
+ queryClient.invalidateQueries({
1499
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
1500
+ });
1501
+ queryClient.invalidateQueries({
1502
+ queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1503
+ });
1504
+ queryClient.invalidateQueries({
1505
+ queryKey: getHbdAssetGeneralInfoQueryOptions(username).queryKey
1506
+ });
1507
+ queryClient.invalidateQueries({
1508
+ queryKey: getHivePowerAssetGeneralInfoQueryOptions(username).queryKey
1509
+ });
1510
+ ["HIVE", "HBD", "HP"].forEach((asset) => {
1511
+ queryClient.invalidateQueries({
1512
+ queryKey: ["ecency-wallets", "asset-info", username, asset]
1513
+ });
1514
+ });
1515
+ }, 5e3);
1491
1516
  },
1492
1517
  auth
1493
1518
  );
@@ -2690,6 +2715,13 @@ function useClaimPoints(username, accessToken, onSuccess, onError) {
2690
2715
  );
2691
2716
  if (!response.ok) {
2692
2717
  const body = await response.text();
2718
+ if (response.status === 406) {
2719
+ try {
2720
+ return JSON.parse(body);
2721
+ } catch {
2722
+ return { message: body, code: response.status };
2723
+ }
2724
+ }
2693
2725
  throw new Error(
2694
2726
  `[SDK][Wallets][Assets][Points][Claim] \u2013 failed with status ${response.status}${body ? `: ${body}` : ""}`
2695
2727
  );
@@ -4264,6 +4296,12 @@ function useWalletOperation(username, asset, operation, auth) {
4264
4296
  5e3
4265
4297
  );
4266
4298
  });
4299
+ setTimeout(
4300
+ () => getQueryClient().invalidateQueries({
4301
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
4302
+ }),
4303
+ 4e3
4304
+ );
4267
4305
  }
4268
4306
  });
4269
4307
  }