@matchain/matchid-sdk-react 0.1.48-alpha.20 → 0.1.48-alpha.21

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.
@@ -11,7 +11,7 @@ import {
11
11
  useUserInfo,
12
12
  verifyPohApi,
13
13
  wallet_exports
14
- } from "./chunk-WHZ3HI4R.mjs";
14
+ } from "./chunk-CHWBALAC.mjs";
15
15
  import {
16
16
  __export
17
17
  } from "./chunk-J5LGTIGS.mjs";
@@ -94,4 +94,4 @@ export {
94
94
  user_exports,
95
95
  api_exports
96
96
  };
97
- //# sourceMappingURL=chunk-3UVHHJP6.mjs.map
97
+ //# sourceMappingURL=chunk-IV4F5SHJ.mjs.map
@@ -2780,11 +2780,9 @@ function useMatchWalletRecords() {
2780
2780
  }
2781
2781
  }, [chainId, address]);
2782
2782
  const { getTransactions, removeTransaction } = useTransactionStore_default();
2783
- const localTransaction = (0, import_react14.useMemo)(() => {
2784
- return getTransactions(chainId || 0, address) || [];
2785
- }, [getTransactions, chainId]);
2786
- (0, import_react14.useEffect)(() => {
2787
- const removeList = localTransaction.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
2783
+ const list = (0, import_react14.useMemo)(() => {
2784
+ const localTransactions = getTransactions(chainId || 0, address) || [];
2785
+ const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
2788
2786
  removeList.forEach((item) => {
2789
2787
  removeTransaction({
2790
2788
  chainId: chainId || 0,
@@ -2792,16 +2790,18 @@ function useMatchWalletRecords() {
2792
2790
  address
2793
2791
  });
2794
2792
  });
2795
- }, [localTransaction, items]);
2796
- return {
2797
- items: [
2798
- ...getTransactions(chainId || 0, address) || [],
2793
+ const saveList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) < 0);
2794
+ return [
2795
+ ...saveList,
2799
2796
  ...items
2800
2797
  ].sort((a, b) => {
2801
2798
  const btimestamp = typeof b.timestamp === "string" ? parseInt(b.timestamp) : b.timestamp;
2802
2799
  const atimestamp = typeof a.timestamp === "string" ? parseInt(a.timestamp) : a.timestamp;
2803
2800
  return btimestamp - atimestamp;
2804
- }),
2801
+ });
2802
+ }, [getTransactions, chainId, items, address]);
2803
+ return {
2804
+ items: list,
2805
2805
  fetchMoreData,
2806
2806
  hasMore
2807
2807
  };