fix(client): update editor when code is reset
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
10d2559fee
commit
a959d462e9
@ -307,6 +307,7 @@ class Editor extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { challengeFiles, theme } = this.props;
|
const { challengeFiles, theme } = this.props;
|
||||||
|
const contents = challengeFiles[this.currentFileKey].contents;
|
||||||
const editorTheme = theme === 'night' ? 'vs-dark-custom' : 'vs-custom';
|
const editorTheme = theme === 'night' ? 'vs-dark-custom' : 'vs-custom';
|
||||||
|
|
||||||
// TODO: tabs should be dynamically created from the challengeFiles
|
// TODO: tabs should be dynamically created from the challengeFiles
|
||||||
@ -356,6 +357,7 @@ class Editor extends Component {
|
|||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
options={this.options}
|
options={this.options}
|
||||||
theme={editorTheme}
|
theme={editorTheme}
|
||||||
|
value={contents}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
Reference in New Issue
Block a user