@ludo.ninja/components 2.1.27 → 2.1.30

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.
@@ -45,6 +45,9 @@ const useFetchMyFavoritesV2 = () => {
45
45
  try {
46
46
  const { data } = await fetchMore({
47
47
  variables: { pageToken },
48
+ updateQuery: (previousQueryResult) => {
49
+ return previousQueryResult;
50
+ },
48
51
  });
49
52
  const { galleries, nextPageToken } = data.fetchMyFavoritesV2;
50
53
  if (galleries) {
@@ -47,6 +47,9 @@ const useFetchMyGalleriesV2 = () => {
47
47
  try {
48
48
  const { data } = await fetchMore({
49
49
  variables: { pageToken },
50
+ updateQuery: (previousQueryResult) => {
51
+ return previousQueryResult;
52
+ },
50
53
  });
51
54
  const { galleries, nextPageToken } = data.fetchMyGalleriesV2;
52
55
  if (galleries) {
@@ -65,6 +65,9 @@ const useFindUserCreations = ({ ownerId, input, scrollTab, }) => {
65
65
  size: limit,
66
66
  },
67
67
  },
68
+ updateQuery: (previousQueryResult) => {
69
+ return previousQueryResult;
70
+ },
68
71
  });
69
72
  const { creations: nextCreations, ...nextPage } = data.findUserCreations;
70
73
  setCreations((prevCreations) => [
@@ -62,7 +62,7 @@ const ToTopBtnIconResize = () => {
62
62
  };
63
63
  const ToTopBtn = () => {
64
64
  const [showBtn, setShowBtn] = (0, react_1.useState)(false);
65
- let oldScrollY = document.documentElement.scrollTop;
65
+ // let oldScrollY = document.documentElement.scrollTop;
66
66
  const offsetPixels = 600;
67
67
  (0, react_1.useEffect)(() => {
68
68
  window.addEventListener('scroll', handleScroll);
@@ -73,14 +73,14 @@ const ToTopBtn = () => {
73
73
  };
74
74
  const handleScroll = () => {
75
75
  if ((0, ui_1.upBtnDistance)(document, offsetPixels)) {
76
- if (oldScrollY > document.documentElement.scrollTop) {
77
- setShowBtn(true);
78
- }
79
- oldScrollY = document.documentElement.scrollTop;
76
+ // if (oldScrollY > document.documentElement.scrollTop) {
77
+ setShowBtn(true);
78
+ // }
79
+ // oldScrollY = document.documentElement.scrollTop;
80
80
  }
81
81
  else {
82
82
  setShowBtn(false);
83
- oldScrollY = offsetPixels;
83
+ // oldScrollY = offsetPixels;
84
84
  }
85
85
  };
86
86
  if (!showBtn)
@@ -131,6 +131,9 @@ const useFindCollectionsAndLikes = ({ term, input, page, }) => {
131
131
  input,
132
132
  page,
133
133
  },
134
+ updateQuery: (previousQueryResult) => {
135
+ return previousQueryResult;
136
+ },
134
137
  });
135
138
  const { collections: nextCollections, ...nextPage } = data.findCollections;
136
139
  const nextList = nextCollections.map((collectionAsset) => new CollectionCreationEntity_1.default({
@@ -108,6 +108,9 @@ const useFindCreationsAndLikes = ({ term, input, page, }) => {
108
108
  ...(page && 'size' in page ? { size: page.size } : {}),
109
109
  },
110
110
  },
111
+ updateQuery: (previousQueryResult) => {
112
+ return previousQueryResult;
113
+ },
111
114
  });
112
115
  const { creations: nextCreations, ...nextPage } = data.findCreations;
113
116
  setCreations((prevCreations) => [
@@ -135,6 +135,9 @@ const useGetCreationsAndLikesByType = ({ itemType, page, }) => {
135
135
  ...(page && 'size' in page ? { size: page.size } : {}),
136
136
  },
137
137
  },
138
+ updateQuery: (previousQueryResult) => {
139
+ return previousQueryResult;
140
+ },
138
141
  });
139
142
  const { creations: nextCreations, ...token } = data.fetchCreationsByType;
140
143
  setAllCreations((prevCreations) => [
@@ -6,20 +6,20 @@ const react_1 = require("react");
6
6
  const toTopBtn_1 = require("../../components/toTopBtn");
7
7
  const useVirtuosoToTopBtnInitialize = () => {
8
8
  const [isShowBtn, setIsShowBtn] = (0, react_1.useState)(false);
9
- const oldScrollY = (0, react_1.useRef)(0);
9
+ // const oldScrollY = useRef(0);
10
10
  const offsetPixels = 600;
11
11
  return {
12
12
  isShowBtn,
13
13
  onScroll(scrollY) {
14
14
  if (scrollY > offsetPixels) {
15
- if (oldScrollY.current > scrollY) {
16
- setIsShowBtn(true);
17
- }
18
- oldScrollY.current = scrollY;
15
+ // if (oldScrollY.current > scrollY) {
16
+ setIsShowBtn(true);
17
+ // }
18
+ // oldScrollY.current = scrollY;
19
19
  }
20
20
  else {
21
21
  setIsShowBtn(false);
22
- oldScrollY.current = offsetPixels;
22
+ // oldScrollY.current = offsetPixels;
23
23
  }
24
24
  },
25
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.1.27",
3
+ "version": "2.1.30",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",