Merge pull request #87 from lbryio/delete-modal-buttons

My Files page: make buttons in "delete" modal work
This commit is contained in:
alexliebowitz 2016-11-21 22:28:47 -05:00 committed by GitHub
commit fd7091cbcf

View file

@ -24,7 +24,12 @@ var MyFilesRowMoreMenu = React.createClass({
}, },
handleDeleteConfirmed: function() { handleDeleteConfirmed: function() {
lbry.deleteFile(this.props.lbryUri); lbry.deleteFile(this.props.lbryUri);
lbry.setState({ this.setState({
modal: null,
});
},
closeModal: function() {
this.setState({
modal: null, modal: null,
}); });
}, },
@ -43,7 +48,8 @@ var MyFilesRowMoreMenu = React.createClass({
<MenuItem onClick={this.handleDeleteClicked} label="Remove and delete file" /> <MenuItem onClick={this.handleDeleteClicked} label="Remove and delete file" />
</section> </section>
</Menu> </Menu>
<Modal isOpen={this.state.modal == 'confirmDelete'} type="confirm" confirmButtonLabel="Delete File" onConfirmed={this.handleDeleteConfirmed}> <Modal isOpen={this.state.modal == 'confirmDelete'} type="confirm" confirmButtonLabel="Delete File"
onConfirmed={this.handleDeleteConfirmed} onAborted={this.closeModal}>
Are you sure you'd like to delete <cite>{this.props.title}</cite>? This will {this.props.completed ? ' stop the download and ' : ''} Are you sure you'd like to delete <cite>{this.props.title}</cite>? This will {this.props.completed ? ' stop the download and ' : ''}
permanently remove the file from your system. permanently remove the file from your system.
</Modal> </Modal>