@ape.swap/bonds-sdk 1.0.540 → 1.0.541
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,19 +10,17 @@ export default function useChainFilterOption() {
|
|
|
11
10
|
queryFn: function () { return cookie; },
|
|
12
11
|
initialData: cookie,
|
|
13
12
|
}).data;
|
|
14
|
-
var
|
|
15
|
-
var query = new URLSearchParams(window.location.search);
|
|
16
|
-
var pathname = window.location.pathname;
|
|
17
|
-
var urlParams = typeof window !== 'undefined' ? new URLSearchParams(new URL(asPath).search) : null;
|
|
13
|
+
var urlParams = typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : null;
|
|
18
14
|
var urlChain = (_a = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('chain')) !== null && _a !== void 0 ? _a : '';
|
|
19
15
|
var queryClient = useQueryClient();
|
|
20
16
|
var removeURLChain = useCallback(function () {
|
|
21
|
-
if (urlChain) {
|
|
17
|
+
if (urlChain && urlParams) {
|
|
22
18
|
console.log('remove url');
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
urlParams.delete('chain');
|
|
20
|
+
var newUrl = "".concat(window.location.pathname, "?").concat(urlParams.toString());
|
|
21
|
+
window.history.replaceState({}, '', newUrl);
|
|
25
22
|
}
|
|
26
|
-
}, [urlChain,
|
|
23
|
+
}, [urlChain, urlParams]);
|
|
27
24
|
var setChainFilterOption = useCallback(function (newValue) {
|
|
28
25
|
updateCookie(newValue);
|
|
29
26
|
queryClient.setQueryData(["".concat(QUERY_KEYS.CHAIN_FILTER_OPTION)], newValue);
|
|
@@ -5,6 +5,7 @@ export declare const QUERY_KEYS: {
|
|
|
5
5
|
LHD_PROFILE: string;
|
|
6
6
|
LHD_PASSWORD_VERIFIED: string;
|
|
7
7
|
HOMEPAGE_STATS: string;
|
|
8
|
+
BOND_PAGE_STATS: string;
|
|
8
9
|
LIVE_AND_UPCOMING: string;
|
|
9
10
|
TVL_STATS: string;
|
|
10
11
|
TOKEN_HISTORIC: string;
|
|
@@ -18,4 +19,6 @@ export declare const QUERY_KEYS: {
|
|
|
18
19
|
HOT_BONDS: string;
|
|
19
20
|
CHAIN_FILTER_OPTION: string;
|
|
20
21
|
AB_TEST_VALUE: string;
|
|
22
|
+
USE_CURRENCY_NEW: string;
|
|
23
|
+
CURRENCY_BALANCE: string;
|
|
21
24
|
};
|
|
@@ -5,6 +5,7 @@ export var QUERY_KEYS = {
|
|
|
5
5
|
LHD_PROFILE: 'lhdProfile',
|
|
6
6
|
LHD_PASSWORD_VERIFIED: 'lhdPasswordVerified',
|
|
7
7
|
HOMEPAGE_STATS: 'homepageStats',
|
|
8
|
+
BOND_PAGE_STATS: 'bondPageStats',
|
|
8
9
|
LIVE_AND_UPCOMING: 'liveAndUpcoming',
|
|
9
10
|
TVL_STATS: 'tvlStats',
|
|
10
11
|
TOKEN_HISTORIC: 'tokenHistoric',
|
|
@@ -18,4 +19,6 @@ export var QUERY_KEYS = {
|
|
|
18
19
|
HOT_BONDS: 'hotBonds',
|
|
19
20
|
CHAIN_FILTER_OPTION: 'chainFilterOption',
|
|
20
21
|
AB_TEST_VALUE: 'ABTestValue',
|
|
22
|
+
USE_CURRENCY_NEW: 'useCurrencyNew',
|
|
23
|
+
CURRENCY_BALANCE: 'currencyBalance',
|
|
21
24
|
};
|