monaca 需要刷新,不然无法编辑

dev_forum
hjm 5 years ago
parent c9801f9259
commit c29c8253a4

@ -114,7 +114,7 @@ class MainContent extends Component {
? ?
readRepoTimeout === true ? <div className="readRepoFailed"> readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry" 代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true)}>重试</a> onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> : </div> :
<React.Fragment> <React.Fragment>
<div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}> <div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}>

@ -235,7 +235,7 @@ class MainContentContainer extends Component {
} }
// arg_path 点击文件目录树时传入的点击节点对应的path // arg_path 点击文件目录树时传入的点击节点对应的path
fetchRepositoryCode( props, arg_path, type, isRetry) { fetchRepositoryCode( props, arg_path, type, isRetry, retryAndRefresh) {
const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props; const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props;
if (shixun.vnc == true) { if (shixun.vnc == true) {
// vnc模式下不需要加载代码 // vnc模式下不需要加载代码
@ -293,6 +293,10 @@ class MainContentContainer extends Component {
// that._cancel = c; // that._cancel = c;
// }) // })
}).then((fetchRepositoryCodeResponse) => { }).then((fetchRepositoryCodeResponse) => {
if (retryAndRefresh && fetchRepositoryCodeResponse.data.content) {
window.location.reload()
return;
}
// 空字符串还是正常切换 // 空字符串还是正常切换
if (fetchRepositoryCodeResponse.data.status == 0) { if (fetchRepositoryCodeResponse.data.status == 0) {
readingRepoTimes = readingRepoTimes + 1; readingRepoTimes = readingRepoTimes + 1;

Loading…
Cancel
Save