Skip to content

Commit

Permalink
fix: Back not reflect proper state in profile (#559)
Browse files Browse the repository at this point in the history
Co-authored-by: Reynaldo WIJAYA HENDRY <[email protected]>
  • Loading branch information
rwhendry and Reynaldo WIJAYA HENDRY authored Dec 1, 2023
1 parent 2fc7f8c commit b5e8eae
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import ContestHistoryPage from './contestHistory/ContestHistoryPage/ContestHisto
import SubmissionHistoryPage from './submissionHistory/SubmissionHistoryPage/SubmissionHistoryPage';
import { selectUserJid, selectUsername } from '../../modules/profileSelectors';

function SingleProfileRoutes({ userJid, username }) {
if (!userJid) {
function SingleProfileRoutes({ match, userJid, username }) {
// Optimization:
// We wait until we get the username from the backend only if the current username is different from the persisted one.
if (!userJid || username !== match.params.username) {
return <LoadingState large />;
}

Expand Down

0 comments on commit b5e8eae

Please sign in to comment.