fix(core): fix member list fallback size (#8133)
This commit is contained in:
@@ -35,6 +35,7 @@ import {
|
|||||||
import { cssVar } from '@toeverything/theme';
|
import { cssVar } from '@toeverything/theme';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { useSetAtom } from 'jotai';
|
import { useSetAtom } from 'jotai';
|
||||||
|
import { clamp } from 'lodash-es';
|
||||||
import type { ReactElement } from 'react';
|
import type { ReactElement } from 'react';
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
@@ -286,9 +287,10 @@ const MemberList = ({
|
|||||||
<MemberListFallback
|
<MemberListFallback
|
||||||
memberCount={
|
memberCount={
|
||||||
memberCount
|
memberCount
|
||||||
? Math.max(
|
? clamp(
|
||||||
memberCount - pageNum * membersService.members.PAGE_SIZE,
|
memberCount - pageNum * membersService.members.PAGE_SIZE,
|
||||||
1
|
1,
|
||||||
|
membersService.members.PAGE_SIZE
|
||||||
)
|
)
|
||||||
: 1
|
: 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user