@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.
@@ -1501,6 +1501,9 @@ function useClaimRewards(username, auth, onSuccess) {
1501
1501
  queryClient.invalidateQueries({
1502
1502
  queryKey: sdk.getAccountFullQueryOptions(username).queryKey
1503
1503
  });
1504
+ queryClient.invalidateQueries({
1505
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
1506
+ });
1504
1507
  queryClient.invalidateQueries({
1505
1508
  queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1506
1509
  });
@@ -1515,6 +1518,28 @@ function useClaimRewards(username, auth, onSuccess) {
1515
1518
  queryKey: ["ecency-wallets", "asset-info", username, asset]
1516
1519
  });
1517
1520
  });
1521
+ setTimeout(() => {
1522
+ queryClient.invalidateQueries({
1523
+ queryKey: sdk.getAccountFullQueryOptions(username).queryKey
1524
+ });
1525
+ queryClient.invalidateQueries({
1526
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
1527
+ });
1528
+ queryClient.invalidateQueries({
1529
+ queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1530
+ });
1531
+ queryClient.invalidateQueries({
1532
+ queryKey: getHbdAssetGeneralInfoQueryOptions(username).queryKey
1533
+ });
1534
+ queryClient.invalidateQueries({
1535
+ queryKey: getHivePowerAssetGeneralInfoQueryOptions(username).queryKey
1536
+ });
1537
+ ["HIVE", "HBD", "HP"].forEach((asset) => {
1538
+ queryClient.invalidateQueries({
1539
+ queryKey: ["ecency-wallets", "asset-info", username, asset]
1540
+ });
1541
+ });
1542
+ }, 5e3);
1518
1543
  },
1519
1544
  auth
1520
1545
  );
@@ -2717,6 +2742,13 @@ function useClaimPoints(username, accessToken, onSuccess, onError) {
2717
2742
  );
2718
2743
  if (!response.ok) {
2719
2744
  const body = await response.text();
2745
+ if (response.status === 406) {
2746
+ try {
2747
+ return JSON.parse(body);
2748
+ } catch {
2749
+ return { message: body, code: response.status };
2750
+ }
2751
+ }
2720
2752
  throw new Error(
2721
2753
  `[SDK][Wallets][Assets][Points][Claim] \u2013 failed with status ${response.status}${body ? `: ${body}` : ""}`
2722
2754
  );
@@ -4291,6 +4323,12 @@ function useWalletOperation(username, asset, operation, auth) {
4291
4323
  5e3
4292
4324
  );
4293
4325
  });
4326
+ setTimeout(
4327
+ () => sdk.getQueryClient().invalidateQueries({
4328
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
4329
+ }),
4330
+ 4e3
4331
+ );
4294
4332
  }
4295
4333
  });
4296
4334
  }