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