@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.
@@ -2,11 +2,11 @@ import {
2
2
  bind_exports,
3
3
  poh_exports,
4
4
  user_exports
5
- } from "../../chunk-3UVHHJP6.mjs";
5
+ } from "../../chunk-IV4F5SHJ.mjs";
6
6
  import {
7
7
  isSuccess,
8
8
  wallet_exports
9
- } from "../../chunk-WHZ3HI4R.mjs";
9
+ } from "../../chunk-CHWBALAC.mjs";
10
10
  import "../../chunk-UA6XHZHX.mjs";
11
11
  import "../../chunk-WXPVHKGJ.mjs";
12
12
  import "../../chunk-5JHHHLG4.mjs";
@@ -2875,11 +2875,9 @@ function useMatchWalletRecords() {
2875
2875
  }
2876
2876
  }, [chainId, address]);
2877
2877
  const { getTransactions, removeTransaction } = useTransactionStore_default();
2878
- const localTransaction = (0, import_react37.useMemo)(() => {
2879
- return getTransactions(chainId || 0, address) || [];
2880
- }, [getTransactions, chainId]);
2881
- (0, import_react37.useEffect)(() => {
2882
- const removeList = localTransaction.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
2878
+ const list = (0, import_react37.useMemo)(() => {
2879
+ const localTransactions = getTransactions(chainId || 0, address) || [];
2880
+ const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
2883
2881
  removeList.forEach((item) => {
2884
2882
  removeTransaction({
2885
2883
  chainId: chainId || 0,
@@ -2887,16 +2885,18 @@ function useMatchWalletRecords() {
2887
2885
  address
2888
2886
  });
2889
2887
  });
2890
- }, [localTransaction, items]);
2891
- return {
2892
- items: [
2893
- ...getTransactions(chainId || 0, address) || [],
2888
+ const saveList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) < 0);
2889
+ return [
2890
+ ...saveList,
2894
2891
  ...items
2895
2892
  ].sort((a, b) => {
2896
2893
  const btimestamp = typeof b.timestamp === "string" ? parseInt(b.timestamp) : b.timestamp;
2897
2894
  const atimestamp = typeof a.timestamp === "string" ? parseInt(a.timestamp) : a.timestamp;
2898
2895
  return btimestamp - atimestamp;
2899
- }),
2896
+ });
2897
+ }, [getTransactions, chainId, items, address]);
2898
+ return {
2899
+ items: list,
2900
2900
  fetchMoreData,
2901
2901
  hasMore
2902
2902
  };