Created
December 17, 2019 04:04
-
-
Save ryanpedersen42/5b73d6f9e03a8f753972b679119180e1 to your computer and use it in GitHub Desktop.
Add New Image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onSubmit = (event) => { | |
| const { toggleAddImage, startLoading, endLoading } = this.props; | |
| event.preventDefault() | |
| startLoading() | |
| //add to IPFS | |
| ipfs.add(this.state.buffer, (error, result) => { | |
| const petHash = result[0].hash | |
| this.setState({ petHash }) | |
| if(error) { | |
| console.error(error) | |
| return | |
| } | |
| //add to 3Box | |
| this.addTo3Box() | |
| this.setState({ buffer: null, imageDecription: ''}) | |
| endLoading() | |
| toggleAddImage() | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment