@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.
@@ -1699,11 +1699,9 @@ function useMatchWalletRecords() {
1699
1699
  }
1700
1700
  }, [chainId, address]);
1701
1701
  const { getTransactions, removeTransaction } = useTransactionStore_default();
1702
- const localTransaction = useMemo4(() => {
1703
- return getTransactions(chainId || 0, address) || [];
1704
- }, [getTransactions, chainId]);
1705
- useEffect6(() => {
1706
- const removeList = localTransaction.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
1702
+ const list = useMemo4(() => {
1703
+ const localTransactions = getTransactions(chainId || 0, address) || [];
1704
+ const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
1707
1705
  removeList.forEach((item) => {
1708
1706
  removeTransaction({
1709
1707
  chainId: chainId || 0,
@@ -1711,16 +1709,18 @@ function useMatchWalletRecords() {
1711
1709
  address
1712
1710
  });
1713
1711
  });
1714
- }, [localTransaction, items]);
1715
- return {
1716
- items: [
1717
- ...getTransactions(chainId || 0, address) || [],
1712
+ const saveList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) < 0);
1713
+ return [
1714
+ ...saveList,
1718
1715
  ...items
1719
1716
  ].sort((a, b) => {
1720
1717
  const btimestamp = typeof b.timestamp === "string" ? parseInt(b.timestamp) : b.timestamp;
1721
1718
  const atimestamp = typeof a.timestamp === "string" ? parseInt(a.timestamp) : a.timestamp;
1722
1719
  return btimestamp - atimestamp;
1723
- }),
1720
+ });
1721
+ }, [getTransactions, chainId, items, address]);
1722
+ return {
1723
+ items: list,
1724
1724
  fetchMoreData,
1725
1725
  hasMore
1726
1726
  };
@@ -6338,4 +6338,4 @@ export {
6338
6338
  MatchProvider,
6339
6339
  useMatch
6340
6340
  };
6341
- //# sourceMappingURL=chunk-WHZ3HI4R.mjs.map
6341
+ //# sourceMappingURL=chunk-CHWBALAC.mjs.map