diff options
Diffstat (limited to 'client/faceAnalysis/faceAnalysis.query.js')
| -rw-r--r-- | client/faceAnalysis/faceAnalysis.query.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/faceAnalysis/faceAnalysis.query.js b/client/faceAnalysis/faceAnalysis.query.js index a79e3e78..33dd641f 100644 --- a/client/faceAnalysis/faceAnalysis.query.js +++ b/client/faceAnalysis/faceAnalysis.query.js @@ -19,13 +19,23 @@ class FaceAnalysisQuery extends Component { } upload(blob) { + if (this.state.image) { + URL.revokeObjectURL(this.state.image) + } + const url = URL.createObjectURL(blob) + this.setState({ image: url }) this.props.actions.upload(this.props.payload, blob) } + componentWillUnmount() { + if (this.state.image) { + URL.revokeObjectURL(this.state.image) + } + } + render() { const { result } = this.props const { image } = this.state - console.log(result) const style = {} if (image) { style.backgroundImage = 'url(' + image + ')' |
