Skip to content

Commit

Permalink
[Fixed] Crash on Pool Details
Browse files Browse the repository at this point in the history
  • Loading branch information
greedyboi committed Feb 23, 2024
1 parent e66be94 commit e3a0085
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/pages/PoolDetails/PoolDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const PoolDetails = () => {
const [smallDrawsHistoryVisibleItem, setSmallDrawsHistoryVisibleItem] = useState(0);
const [drawInProgress, setDrawInProgress] = useState(false);
const [selectedDraw, setSelectedDraw] = useState<Draw | null>(null);
const [userRankItems, setUserRankItems] = useState<LeaderboardItemModel[]>();
const [userRankItems, setUserRankItems] = useState<LeaderboardItemModel[] | undefined>();

const modalRef = useRef<React.ElementRef<typeof Modal>>(null);

Expand All @@ -61,9 +61,7 @@ const PoolDetails = () => {
if (pool && lumWallet) {
const userRankItems = await dispatch.wallet.getLeaderboardRank(pool.poolId);

if (userRankItems) {
setUserRankItems([...userRankItems]);
}
setUserRankItems(userRankItems && userRankItems.length > 0 ? [...userRankItems] : undefined);
} else {
setUserRankItems(undefined);
}
Expand Down

0 comments on commit e3a0085

Please sign in to comment.