fix(learn): reload when challenge tests change (#39832)
This commit is contained in:
committed by
GitHub
parent
5f67843e50
commit
b0e3d7369b
@ -129,15 +129,21 @@ class ShowClassic extends Component {
|
||||
componentDidUpdate(prevProps) {
|
||||
const {
|
||||
data: {
|
||||
challengeNode: { title: prevTitle }
|
||||
challengeNode: {
|
||||
title: prevTitle,
|
||||
fields: { tests: prevTests }
|
||||
}
|
||||
}
|
||||
} = prevProps;
|
||||
const {
|
||||
data: {
|
||||
challengeNode: { title: currentTitle }
|
||||
challengeNode: {
|
||||
title: currentTitle,
|
||||
fields: { tests: currTests }
|
||||
}
|
||||
}
|
||||
} = this.props;
|
||||
if (prevTitle !== currentTitle) {
|
||||
if (prevTitle !== currentTitle || prevTests !== currTests) {
|
||||
this.initializeComponent(currentTitle);
|
||||
}
|
||||
}
|
||||
|
@ -100,16 +100,22 @@ export class BackEnd extends Component {
|
||||
componentDidUpdate(prevProps) {
|
||||
const {
|
||||
data: {
|
||||
challengeNode: { title: prevTitle }
|
||||
challengeNode: {
|
||||
title: prevTitle,
|
||||
fields: { tests: prevTests }
|
||||
}
|
||||
}
|
||||
} = prevProps;
|
||||
const {
|
||||
data: {
|
||||
challengeNode: { title: currentTitle }
|
||||
challengeNode: {
|
||||
title: currentTitle,
|
||||
fields: { tests: currTests }
|
||||
}
|
||||
}
|
||||
} = this.props;
|
||||
if (prevTitle !== currentTitle) {
|
||||
this.initializeComponent();
|
||||
if (prevTitle !== currentTitle || prevTests !== currTests) {
|
||||
this.initializeComponent(currentTitle);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user