@ecency/wallets 1.5.3 → 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,9 +1476,45 @@ 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
+ });
1482
+ queryClient.invalidateQueries({
1483
+ queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1484
+ });
1485
+ queryClient.invalidateQueries({
1486
+ queryKey: getHbdAssetGeneralInfoQueryOptions(username).queryKey
1487
+ });
1479
1488
  queryClient.invalidateQueries({
1480
1489
  queryKey: getHivePowerAssetGeneralInfoQueryOptions(username).queryKey
1481
1490
  });
1491
+ ["HIVE", "HBD", "HP"].forEach((asset) => {
1492
+ queryClient.invalidateQueries({
1493
+ queryKey: ["ecency-wallets", "asset-info", username, asset]
1494
+ });
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);
1482
1518
  },
1483
1519
  auth
1484
1520
  );
@@ -2681,6 +2717,13 @@ function useClaimPoints(username, accessToken, onSuccess, onError) {
2681
2717
  );
2682
2718
  if (!response.ok) {
2683
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
+ }
2684
2727
  throw new Error(
2685
2728
  `[SDK][Wallets][Assets][Points][Claim] \u2013 failed with status ${response.status}${body ? `: ${body}` : ""}`
2686
2729
  );
@@ -4255,6 +4298,12 @@ function useWalletOperation(username, asset, operation, auth) {
4255
4298
  5e3
4256
4299
  );
4257
4300
  });
4301
+ setTimeout(
4302
+ () => getQueryClient().invalidateQueries({
4303
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
4304
+ }),
4305
+ 4e3
4306
+ );
4258
4307
  }
4259
4308
  });
4260
4309
  }