修复issues命令行时间及代码块内容不显示问题

dev_daiao
tangjiang 5 years ago
parent 9badfaebb6
commit fc4ec9aab3

@ -47,7 +47,7 @@ const five_min = 5 * 60 * 1000;
倒计时为0时出现重启按钮 倒计时为0时出现重启按钮
*/ */
const isSSHInIframe = false; const isSSHInIframe = false;
class WebSSHTimer extends React.PureComponent { class WebSSHTimer extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -165,7 +165,6 @@ class WebSSHTimer extends React.PureComponent {
}) })
} }
componentDidUpdate(prevProps, prevState, snapshot) { componentDidUpdate(prevProps, prevState, snapshot) {
console.log('======',prevProps, this.state, this.startTimeRemain);
// 仅初始化一次 // 仅初始化一次
if (prevProps.showTimerProp === false && this.props.showTimerProp === true) { if (prevProps.showTimerProp === false && this.props.showTimerProp === true) {
if (this.intervalHandler) { if (this.intervalHandler) {
@ -199,8 +198,8 @@ class WebSSHTimer extends React.PureComponent {
// } // }
} else if (e.data.tp === "sshWorking") { } else if (e.data.tp === "sshWorking") {
this.startTimeRemain = 60; // this.startTimeRemain = 60;
this.forceUpdate() // this.forceUpdate();
} }
}); });
// } else { // } else {

@ -244,7 +244,9 @@ class TPIMonaco extends Component {
// 重要setState(因获取代码、重置代码等接口引起的调用)调用引起的变化才需要setValue // 重要setState(因获取代码、重置代码等接口引起的调用)调用引起的变化才需要setValue
editor_monaco.setValue(this.props.repositoryCode) editor_monaco.setValue(this.props.repositoryCode)
} }
// 代码没变也需要layout可能从命令行自动切回了代码tab // 代码没变也需要layout可能从命令行自动切回了代码tab
editor_monaco.layout();
// Clears the editor's undo history. // Clears the editor's undo history.
// TODO // TODO

Loading…
Cancel
Save