🐛 commit filename changes upon saving sketch

This commit is contained in:
ghalestrilo 2020-04-07 20:29:20 -03:00
parent 434cf6da21
commit 26df651f2f

View file

@ -132,7 +132,9 @@ export function saveProject(selectedFile = null, autosave = false) {
return Promise.reject();
}
const formParams = Object.assign({}, state.project);
formParams.files = [...state.files];
formParams.files = [...state.files.map(file => ({ ...file, name: file.updatedName || file.name }))];
formParams.files.forEach((file) => { delete file.updatedName; });
if (selectedFile) {
const fileToUpdate = formParams.files.find(file => file.id === selectedFile.id);
fileToUpdate.content = selectedFile.content;