Skip to content

Commit eb323ed

Browse files
committed
fix: cursor comment
1 parent 68b3cf4 commit eb323ed

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

app/components/Views/Homepage/Sections/Predictions/PredictionsSection.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,18 @@ const PredictionsSectionDefault = forwardRef<
391391
const hasError =
392392
!isLoadingPositions &&
393393
!isLoadingMarkets &&
394+
!isLoadingClaimable &&
394395
!hasAnyPositions &&
395396
markets.length === 0 &&
396397
(positionsError || marketsError);
397398
const isEmpty =
398399
!isLoading && !hasAnyPositions && markets.length === 0 && !hasError;
399400
const willRender = isPredictEnabled && !isLoading && !isEmpty && !hasError;
400-
const itemCount = hasAnyPositions ? positions.length : markets.length;
401+
const itemCount = hasPositions
402+
? positions.length
403+
: hasClaimablePositions
404+
? markets.length || 1
405+
: markets.length;
401406

402407
const { onLayout } = useHomeViewedEvent({
403408
sectionRef: willRender ? sectionViewRef : null,
@@ -523,7 +528,11 @@ const PredictionsSectionPositionsOnly = forwardRef<
523528
const hasAnyPositions = hasPositions || hasClaimablePositions;
524529
const isLoading = isLoadingPositions || isLoadingClaimable;
525530
const willRender = isPredictEnabled && !isLoading && hasAnyPositions;
526-
const itemCount = hasAnyPositions ? positions.length : 0;
531+
const itemCount = hasPositions
532+
? positions.length
533+
: hasClaimablePositions
534+
? 1
535+
: 0;
527536

528537
const { onLayout } = useHomeViewedEvent({
529538
sectionRef: willRender ? sectionViewRef : null,

0 commit comments

Comments
 (0)