diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx index 622709bdd..e22baebf2 100644 --- a/src/containers/costume-tab.jsx +++ b/src/containers/costume-tab.jsx @@ -87,8 +87,9 @@ class CostumeTab extends React.Component { this.props.vm.deleteCostume(costumeIndex); } handleDuplicateCostume (costumeIndex) { - this.props.vm.duplicateCostume(costumeIndex); - this.setState({selectedCostumeIndex: costumeIndex + 1}); + this.props.vm.duplicateCostume(costumeIndex).then(() => { + this.setState({selectedCostumeIndex: costumeIndex + 1}); + }); } handleNewCostume () { if (!this.props.vm.editingTarget) return; @@ -203,7 +204,7 @@ CostumeTab.propTypes = { costumes: PropTypes.arrayOf(PropTypes.shape({ url: PropTypes.string, name: PropTypes.string.isRequired, - costumeId: PropTypes.number + skinId: PropTypes.number })) }) }), diff --git a/src/containers/paint-editor-wrapper.jsx b/src/containers/paint-editor-wrapper.jsx index ad248b83f..38cb3aa4a 100644 --- a/src/containers/paint-editor-wrapper.jsx +++ b/src/containers/paint-editor-wrapper.jsx @@ -59,7 +59,7 @@ const mapStateToProps = (state, {selectedCostumeIndex}) => { name: costume && costume.name, rotationCenterX: costume && costume.rotationCenterX, rotationCenterY: costume && costume.rotationCenterY, - svgId: editingTarget && `${editingTarget}${costume.costumeId}` + svgId: editingTarget && `${editingTarget}${costume.skinId}` }; }; diff --git a/src/containers/sound-tab.jsx b/src/containers/sound-tab.jsx index af95c6b0b..8686ae6f9 100644 --- a/src/containers/sound-tab.jsx +++ b/src/containers/sound-tab.jsx @@ -26,6 +26,7 @@ class SoundTab extends React.Component { bindAll(this, [ 'handleSelectSound', 'handleDeleteSound', + 'handleDuplicateSound', 'handleNewSound' ]); this.state = {selectedSoundIndex: 0}; @@ -56,6 +57,12 @@ class SoundTab extends React.Component { } } + handleDuplicateSound (soundIndex) { + this.props.vm.duplicateSound(soundIndex).then(() => { + this.setState({selectedSoundIndex: soundIndex + 1}); + }); + } + handleNewSound () { if (!this.props.vm.editingTarget) { return null; @@ -116,6 +123,7 @@ class SoundTab extends React.Component { }))} selectedItemIndex={this.state.selectedSoundIndex} onDeleteClick={this.handleDeleteSound} + onDuplicateClick={this.handleDuplicateSound} onItemClick={this.handleSelectSound} > {sprite.sounds && sprite.sounds[this.state.selectedSoundIndex] ? (