We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent feade78 commit bcae7e1Copy full SHA for bcae7e1
1 file changed
frontend/src/pages/Problems.tsx
@@ -72,6 +72,7 @@ export default function Problems() {
72
const { user } = useAuth();
73
const [userStats, setUserStats] = useState<{ accepted: number } | null>(null);
74
const totalProblems = stats?.total ?? 0;
75
+ const totalPages = data ? Math.ceil(data.total / pageSize) : 0;
76
77
// Keyboard pagination
78
useEffect(() => {
@@ -205,8 +206,6 @@ export default function Problems() {
205
206
}
207
};
208
- const totalPages = data ? Math.ceil(data.total / pageSize) : 0;
209
-
210
const getPageNumbers = (): (number | '...')[] => {
211
if (totalPages <= 7) {
212
return Array.from({ length: totalPages }, (_, i) => i + 1);
0 commit comments