From 7dd4d74b46e1cb89dead481f7302c9dab22a8b5e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 24 Jul 2019 19:00:48 +0800 Subject: [PATCH] retryAndRefresh --- public/react/src/modules/page/MainContentContainer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js index 947aadaa5..829b84b16 100644 --- a/public/react/src/modules/page/MainContentContainer.js +++ b/public/react/src/modules/page/MainContentContainer.js @@ -236,6 +236,9 @@ class MainContentContainer extends Component { // arg_path 点击文件目录树时,传入的点击节点对应的path fetchRepositoryCode( props, arg_path, type, isRetry, retryAndRefresh) { + if (retryAndRefresh) { + this.retryAndRefresh = retryAndRefresh + } const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props; if (shixun.vnc == true) { // vnc模式下不需要加载代码 @@ -294,7 +297,7 @@ class MainContentContainer extends Component { // }) }).then((fetchRepositoryCodeResponse) => { // monaca 需要刷新,不然无法编辑 - if (retryAndRefresh && fetchRepositoryCodeResponse.data.content) { + if (this.retryAndRefresh && fetchRepositoryCodeResponse.data.content) { window.location.reload() return; }