diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js index 3dc3d07d4..a51f00902 100644 --- a/public/react/src/modules/page/MainContentContainer.js +++ b/public/react/src/modules/page/MainContentContainer.js @@ -224,13 +224,15 @@ class MainContentContainer extends Component { } componentDidUpdate(prevProps, prevState, snapshot) { - const { game } = this.props + const { game, challenge } = this.props if (game && prevProps.game && prevProps.game.identifier !== game.identifier) { // 切换关卡时,停止轮训 this.oldGameIdentifier = prevProps.game.identifier; this.doFileUpdateRequestOnCodeMirrorBlur(prevProps) + } else if (challenge && (challenge.pathIndex || prevProps.challenge.pathIndex) && challenge.pathIndex != prevProps.challenge.pathIndex) { + this.doFileUpdateRequestOnCodeMirrorBlur(prevProps) } }