From a959d462e9d895f26495fe8d55b0a4da93ba956e Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 3 Jun 2020 16:32:24 +0200 Subject: [PATCH] fix(client): update editor when code is reset --- client/src/templates/Challenges/classic/Editor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/templates/Challenges/classic/Editor.js b/client/src/templates/Challenges/classic/Editor.js index 58be74c501..79d250b53e 100644 --- a/client/src/templates/Challenges/classic/Editor.js +++ b/client/src/templates/Challenges/classic/Editor.js @@ -307,6 +307,7 @@ class Editor extends Component { render() { const { challengeFiles, theme } = this.props; + const contents = challengeFiles[this.currentFileKey].contents; const editorTheme = theme === 'night' ? 'vs-dark-custom' : 'vs-custom'; // TODO: tabs should be dynamically created from the challengeFiles @@ -356,6 +357,7 @@ class Editor extends Component { onChange={this.onChange} options={this.options} theme={editorTheme} + value={contents} />