diff --git a/client/modules/IDE/actions/files.js b/client/modules/IDE/actions/files.js index b436034e..7e9a8c80 100644 --- a/client/modules/IDE/actions/files.js +++ b/client/modules/IDE/actions/files.js @@ -29,10 +29,10 @@ function createUniqueName(name, parentId, files) { return testName; } -export function updateFileContent(name, content) { +export function updateFileContent(id, content) { return { type: ActionTypes.UPDATE_FILE_CONTENT, - name, + id, content }; } @@ -206,7 +206,7 @@ export function hideFolderChildren(id) { export function setBlobUrl(file, blobURL) { return { type: ActionTypes.SET_BLOB_URL, - name: file.name, + id: file.id, blobURL }; } diff --git a/client/modules/IDE/components/Editor.jsx b/client/modules/IDE/components/Editor.jsx index e7b6bdce..57c698a1 100644 --- a/client/modules/IDE/components/Editor.jsx +++ b/client/modules/IDE/components/Editor.jsx @@ -116,7 +116,7 @@ class Editor extends React.Component { this._cm.on('change', debounce(() => { this.props.setUnsavedChanges(true); - this.props.updateFileContent(this.props.file.name, this._cm.getValue()); + this.props.updateFileContent(this.props.file.id, this._cm.getValue()); if (this.props.autorefresh && this.props.isPlaying) { this.props.clearConsole(); this.props.startRefreshSketch(); diff --git a/client/modules/IDE/reducers/files.js b/client/modules/IDE/reducers/files.js index 71a0bb62..80d6b73d 100644 --- a/client/modules/IDE/reducers/files.js +++ b/client/modules/IDE/reducers/files.js @@ -118,7 +118,7 @@ const files = (state, action) => { switch (action.type) { case ActionTypes.UPDATE_FILE_CONTENT: return state.map((file) => { - if (file.name !== action.name) { + if (file.id !== action.id) { return file; } @@ -126,7 +126,7 @@ const files = (state, action) => { }); case ActionTypes.SET_BLOB_URL: return state.map((file) => { - if (file.name !== action.name) { + if (file.id !== action.id) { return file; } return Object.assign({}, file, { blobURL: action.blobURL });