Skip to content

Commit 4da77a2

Browse files
committed
Refactor
1 parent 00d7da4 commit 4da77a2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/modules/IDE/components/PreviewFrame.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,17 @@ class PreviewFrame extends React.Component {
143143
return newContent;
144144
}
145145

146+
mergeLocalFilesAndEditorActiveFile() {
147+
const files = this.props.files.slice();
148+
const activeFileInEditor = this.props.cmController.getContent();
149+
files.find(file => file.id === activeFileInEditor.id).content = activeFileInEditor.content;
150+
return files;
151+
}
152+
146153
injectLocalFiles() {
147154
const htmlFile = this.props.htmlFile.content;
148155
let scriptOffs = [];
149-
const files = this.props.files.slice();
156+
const files = this.mergeLocalFilesAndEditorActiveFile();
150157
const activeFileInEditor = this.props.cmController.getContent();
151158
files.find(file => file.id === activeFileInEditor.id).content = activeFileInEditor.content;
152159
const resolvedFiles = this.resolveJSAndCSSLinks(files);

0 commit comments

Comments
 (0)