@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.
@@ -1474,9 +1474,45 @@ 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
+ });
1480
+ queryClient.invalidateQueries({
1481
+ queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1482
+ });
1483
+ queryClient.invalidateQueries({
1484
+ queryKey: getHbdAssetGeneralInfoQueryOptions(username).queryKey
1485
+ });
1477
1486
  queryClient.invalidateQueries({
1478
1487
  queryKey: getHivePowerAssetGeneralInfoQueryOptions(username).queryKey
1479
1488
  });
1489
+ ["HIVE", "HBD", "HP"].forEach((asset) => {
1490
+ queryClient.invalidateQueries({
1491
+ queryKey: ["ecency-wallets", "asset-info", username, asset]
1492
+ });
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);
1480
1516
  },
1481
1517
  auth
1482
1518
  );
@@ -2679,6 +2715,13 @@ function useClaimPoints(username, accessToken, onSuccess, onError) {
2679
2715
  );
2680
2716
  if (!response.ok) {
2681
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
+ }
2682
2725
  throw new Error(
2683
2726
  `[SDK][Wallets][Assets][Points][Claim] \u2013 failed with status ${response.status}${body ? `: ${body}` : ""}`
2684
2727
  );
@@ -4253,6 +4296,12 @@ function useWalletOperation(username, asset, operation, auth) {
4253
4296
  5e3
4254
4297
  );
4255
4298
  });
4299
+ setTimeout(
4300
+ () => getQueryClient().invalidateQueries({
4301
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
4302
+ }),
4303
+ 4e3
4304
+ );
4256
4305
  }
4257
4306
  });
4258
4307
  }