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) {
|
componentDidUpdate(prevProps) {
|
||||||
const {
|
const {
|
||||||
data: {
|
data: {
|
||||||
challengeNode: { title: prevTitle }
|
challengeNode: {
|
||||||
|
title: prevTitle,
|
||||||
|
fields: { tests: prevTests }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} = prevProps;
|
} = prevProps;
|
||||||
const {
|
const {
|
||||||
data: {
|
data: {
|
||||||
challengeNode: { title: currentTitle }
|
challengeNode: {
|
||||||
|
title: currentTitle,
|
||||||
|
fields: { tests: currTests }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} = this.props;
|
} = this.props;
|
||||||
if (prevTitle !== currentTitle) {
|
if (prevTitle !== currentTitle || prevTests !== currTests) {
|
||||||
this.initializeComponent(currentTitle);
|
this.initializeComponent(currentTitle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,16 +100,22 @@ export class BackEnd extends Component {
|
|||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
const {
|
const {
|
||||||
data: {
|
data: {
|
||||||
challengeNode: { title: prevTitle }
|
challengeNode: {
|
||||||
|
title: prevTitle,
|
||||||
|
fields: { tests: prevTests }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} = prevProps;
|
} = prevProps;
|
||||||
const {
|
const {
|
||||||
data: {
|
data: {
|
||||||
challengeNode: { title: currentTitle }
|
challengeNode: {
|
||||||
|
title: currentTitle,
|
||||||
|
fields: { tests: currTests }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} = this.props;
|
} = this.props;
|
||||||
if (prevTitle !== currentTitle) {
|
if (prevTitle !== currentTitle || prevTests !== currTests) {
|
||||||
this.initializeComponent();
|
this.initializeComponent(currentTitle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user