Name uploaded backdrops based on the name

This commit is contained in:
Paul Kaplan committed 2019-02-08 13:44:10 -05:00
1 parent 28635d8028
commit a18ea5a92c
1 file changed
+5 -3
+5 -3
View File
@@ -78,9 +78,11 @@ class StageSelector extends React.Component {
handleBackdropUpload (e) {
const storage = this.props.vm.runtime.storage;
handleFileUpload(e.target, (buffer, fileType, fileName) => {
costumeUpload(buffer, fileType, storage, vmCostume => {
vmCostume.name = fileName;
this.handleNewBackdrop(vmCostume);
costumeUpload(buffer, fileType, storage, vmCostumes => {
vmCostumes.forEach((costume, i) => {
costume.name = `${fileName}${i + 1}`;
});
this.handleNewBackdrop(vmCostumes);
});
});
}