Skip to content

Commit

Permalink
Merge pull request #173 from blend-capital/fix-markets-loading
Browse files Browse the repository at this point in the history
fix: patch pool filtering logic
  • Loading branch information
mootz12 authored Nov 17, 2024
2 parents f4e627e + 1bf466f commit 6eda773
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blend-ui",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
23 changes: 12 additions & 11 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ const Markets: NextPage = () => {

const rewardZone = [...(backstop?.config?.rewardZone ?? [])].reverse();

const safeRewardZone = rewardZone.filter((poolId) => !blockedPools.includes(poolId));

function handlePoolLoaded(index: number) {
if (index >= currentIndex) {
setCurrentIndex(Math.min(currentIndex + 1, rewardZone.length));
setCurrentIndex(Math.min(currentIndex + 1, safeRewardZone.length));
}
}

Expand All @@ -29,16 +31,15 @@ const Markets: NextPage = () => {
</SectionBase>
</Row>
<Divider />
{rewardZone.slice(0, currentIndex + 1).map((poolId, index) => {
if (!blockedPools.includes(poolId))
return (
<MarketCard
key={poolId}
poolId={poolId}
index={index}
onLoaded={handlePoolLoaded}
></MarketCard>
);
{safeRewardZone.slice(0, currentIndex + 1).map((poolId, index) => {
return (
<MarketCard
key={poolId}
poolId={poolId}
index={index}
onLoaded={handlePoolLoaded}
></MarketCard>
);
})}
</>
);
Expand Down

1 comment on commit 6eda773

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.