@ape.swap/bonds-sdk 3.0.40-test.4 → 3.0.40-test.6

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.
Files changed (2) hide show
  1. package/dist/main.js +18 -1
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -77656,12 +77656,29 @@ const Bonds = () => {
77656
77656
  const { data: tokenPrices } = useTokenPrices();
77657
77657
  const SDKConfig = useSDKConfig();
77658
77658
  useEffect(() => {
77659
+ const hash = window.location.hash;
77660
+ if ((bondData === null || bondData === void 0 ? void 0 : bondData.length) > 0 &&
77661
+ (tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length) > 0 &&
77662
+ (allBonds === null || allBonds === void 0 ? void 0 : allBonds.length) > 0 &&
77663
+ hash) {
77664
+ const tryScroll = () => {
77665
+ const element = document.querySelector(hash);
77666
+ if (element) {
77667
+ const y = element.getBoundingClientRect().top + window.scrollY - 70;
77668
+ window.scrollTo({ top: y, behavior: 'smooth' });
77669
+ }
77670
+ else {
77671
+ setTimeout(tryScroll, 50);
77672
+ }
77673
+ };
77674
+ tryScroll();
77675
+ }
77659
77676
  //@ts-ignore
77660
77677
  if ((bondData === null || bondData === void 0 ? void 0 : bondData.length) === 0 && (tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length) > 0 && (allBonds === null || allBonds === void 0 ? void 0 : allBonds.length) > 0) {
77661
77678
  console.log('Real time api call failed, triggering fallback strategy');
77662
77679
  refetchBondsData();
77663
77680
  }
77664
- }, [bondData === null || bondData === void 0 ? void 0 : bondData.length, tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length]);
77681
+ }, [bondData === null || bondData === void 0 ? void 0 : bondData.length, tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length, allBonds === null || allBonds === void 0 ? void 0 : allBonds.length]);
77665
77682
  // State
77666
77683
  const [sortConfig, setSortConfig] = useState({ key: 'bonus', direction: 'desc' });
77667
77684
  const [searchQuery, setSearchQuery] = useState('');
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": "3.0.40-test.4",
6
+ "version": "3.0.40-test.6",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",