diff --git a/judgels-client/src/components/RegradeAllButton/RegradeAllButton.jsx b/judgels-client/src/components/RegradeAllButton/RegradeAllButton.jsx
index 376fd2d1a..352ca7a41 100644
--- a/judgels-client/src/components/RegradeAllButton/RegradeAllButton.jsx
+++ b/judgels-client/src/components/RegradeAllButton/RegradeAllButton.jsx
@@ -1,9 +1,9 @@
import { Button, Intent } from '@blueprintjs/core';
import { Refresh } from '@blueprintjs/icons';
-export function RegradeAllButton({ onRegradeAll }) {
+export function RegradeAllButton({ onRegradeAll, isRegradingAll }) {
return (
- } onClick={onRegradeAll}>
+ } onClick={onRegradeAll} loading={isRegradingAll}>
Regrade all pages
);
diff --git a/judgels-client/src/routes/contests/contests/single/submissions/Programming/ContestSubmissionsPage/ContestSubmissionsPage.jsx b/judgels-client/src/routes/contests/contests/single/submissions/Programming/ContestSubmissionsPage/ContestSubmissionsPage.jsx
index fad0a50ed..8fbe8a7ba 100644
--- a/judgels-client/src/routes/contests/contests/single/submissions/Programming/ContestSubmissionsPage/ContestSubmissionsPage.jsx
+++ b/judgels-client/src/routes/contests/contests/single/submissions/Programming/ContestSubmissionsPage/ContestSubmissionsPage.jsx
@@ -31,6 +31,7 @@ export class ContestSubmissionsPage extends Component {
response: undefined,
filter: { username, problemAlias },
isFilterLoading: false,
+ isRegradingAll: false,
};
}
@@ -70,7 +71,7 @@ export class ContestSubmissionsPage extends Component {
if (!this.state.response || !this.state.response.config.canManage) {
return null;
}
- return ;
+ return ;
};
renderFilterWidget = () => {
@@ -154,7 +155,10 @@ export class ContestSubmissionsPage extends Component {
onRegradeAll = async () => {
if (reallyConfirm('Regrade all submissions in all pages for the current filter?')) {
const { username, problemAlias } = this.state.filter;
+
+ this.setState({ isRegradingAll: true });
await this.props.onRegradeAll(this.props.contest.jid, username, problemAlias);
+ this.setState({ isRegradingAll: false });
const queries = parse(this.props.location.search);
await this.refreshSubmissions(username, problemAlias, queries.page);
}