@ape.swap/bonds-sdk 1.0.528 → 1.0.529

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,7 +2,6 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
2
2
  import { QUERY_KEYS } from '../../config/constants/queryKeys';
3
3
  import useCookie from '../../hooks/useCookie';
4
4
  import { useCallback } from 'react';
5
- import { useRouter } from 'next/router';
6
5
  export default function useChainFilterOption() {
7
6
  var _a;
8
7
  var _b = useCookie(QUERY_KEYS.CHAIN_FILTER_OPTION, ['All Chains']), cookie = _b.cookie, updateCookie = _b.updateCookie;
@@ -11,20 +10,17 @@ export default function useChainFilterOption() {
11
10
  queryFn: function () { return cookie; },
12
11
  initialData: cookie,
13
12
  }).data;
14
- var _c = useRouter(), asPath = _c.asPath, query = _c.query, replace = _c.replace, pathname = _c.pathname;
15
- var urlParams = typeof window !== 'undefined' ? new URLSearchParams(new URL(asPath, window.location.origin).search) : null;
13
+ var urlParams = typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : null;
16
14
  var urlChain = (_a = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('chain')) !== null && _a !== void 0 ? _a : '';
17
15
  var queryClient = useQueryClient();
18
16
  var removeURLChain = useCallback(function () {
19
17
  if (urlChain) {
20
18
  console.log('remove url');
21
- delete query.chain;
22
- replace({
23
- pathname: pathname,
24
- query: query,
25
- }, undefined, { scroll: false });
19
+ urlParams === null || urlParams === void 0 ? void 0 : urlParams.delete('chain');
20
+ var newUrl = "".concat(window.location.pathname, "?").concat(urlParams === null || urlParams === void 0 ? void 0 : urlParams.toString());
21
+ window.history.replaceState(null, '', newUrl);
26
22
  }
27
- }, [urlChain, pathname, query, replace]);
23
+ }, [urlChain, urlParams]);
28
24
  var setChainFilterOption = useCallback(function (newValue) {
29
25
  updateCookie(newValue);
30
26
  queryClient.setQueryData(["".concat(QUERY_KEYS.CHAIN_FILTER_OPTION)], newValue);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.528",
6
+ "version": "1.0.529",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",