Skip to content

Commit

Permalink
Merge pull request #141 from edx/azan/PROD-2434
Browse files Browse the repository at this point in the history
fix: loading spinner for certificate
  • Loading branch information
azanbinzahid authored Jul 16, 2021
2 parents 8e516bb + d504be2 commit 7e2c068
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/users/enrollments/Certificates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default function Certificates({
const oldCourseId = usePrevious(courseId);
const certificateRef = useRef(null);

useEffect(() => {
setCertificateData(undefined);
}, [courseId]);

useEffect(() => {
if ((certificate === undefined && !displayCertErrors) || (courseId !== oldCourseId)) {
getCertificate(username, courseId).then((result) => {
Expand Down

0 comments on commit 7e2c068

Please sign in to comment.