Skip to content

Commit bcae7e1

Browse files
author
CodeJudge
committed
fix: 类型修复
1 parent feade78 commit bcae7e1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

frontend/src/pages/Problems.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export default function Problems() {
7272
const { user } = useAuth();
7373
const [userStats, setUserStats] = useState<{ accepted: number } | null>(null);
7474
const totalProblems = stats?.total ?? 0;
75+
const totalPages = data ? Math.ceil(data.total / pageSize) : 0;
7576

7677
// Keyboard pagination
7778
useEffect(() => {
@@ -205,8 +206,6 @@ export default function Problems() {
205206
}
206207
};
207208

208-
const totalPages = data ? Math.ceil(data.total / pageSize) : 0;
209-
210209
const getPageNumbers = (): (number | '...')[] => {
211210
if (totalPages <= 7) {
212211
return Array.from({ length: totalPages }, (_, i) => i + 1);

0 commit comments

Comments
 (0)