@matchain/matchid-sdk-react 0.1.53-alpha.12 → 0.1.53-alpha.14

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.
@@ -7122,7 +7122,7 @@ __export(contact_exports, {
7122
7122
  });
7123
7123
  import { useInfiniteQuery, useQuery as useQuery10, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
7124
7124
  import last from "lodash/last";
7125
- import { useEffect as useEffect28, useRef as useRef6 } from "react";
7125
+ import { useEffect as useEffect28, useMemo as useMemo18, useRef as useRef6 } from "react";
7126
7126
  function useContactList(page_size = 10, type = "Friend") {
7127
7127
  const { token } = useLocalStore_default();
7128
7128
  const limitIdRef = useRef6(0);
@@ -7161,13 +7161,19 @@ function useContactList(page_size = 10, type = "Friend") {
7161
7161
  limitIdRef.current = lastItem?.limit_id || 0;
7162
7162
  }
7163
7163
  }, [contactQuery.data?.pages]);
7164
- return {
7165
- data: (contactQuery.data?.pages ?? []).reduce(
7164
+ useEffect28(() => {
7165
+ console.log("contactQuery.data", contactQuery.data);
7166
+ }, [contactQuery.data]);
7167
+ const data = useMemo18(() => {
7168
+ return (contactQuery.data?.pages ?? []).reduce(
7166
7169
  (a, b) => {
7167
7170
  return a.concat(b?.items ?? []);
7168
7171
  },
7169
7172
  []
7170
- ),
7173
+ );
7174
+ }, [contactQuery.data]);
7175
+ return {
7176
+ data,
7171
7177
  totalCount: contactQuery.hasNextPage ? (last(contactQuery.data?.pages ?? [])?.meta.total ?? 0) + 1 : last(contactQuery.data?.pages ?? [])?.meta.total ?? 0,
7172
7178
  loading: contactQuery.isLoading,
7173
7179
  loadingNextPage: contactQuery.isFetchingNextPage,
@@ -7272,4 +7278,4 @@ export {
7272
7278
  MatchProvider,
7273
7279
  useMatch
7274
7280
  };
7275
- //# sourceMappingURL=chunk-I2V4VRQH.mjs.map
7281
+ //# sourceMappingURL=chunk-OEKLKWFJ.mjs.map