summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-17 16:49:55 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-17 16:49:55 +0100
commit9703ffa533dbb2106dc74dcfbf883eb4bfc1fa00 (patch)
tree23e6f7201e10d48b0e985268cbd2abcb82958843
parent6595e3d61fb445fc06c835c4f72d4c534524ae33 (diff)
fix query
-rw-r--r--client/faceSearch/faceSearch.query.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/client/faceSearch/faceSearch.query.js b/client/faceSearch/faceSearch.query.js
index de7e47b6..8a82373e 100644
--- a/client/faceSearch/faceSearch.query.js
+++ b/client/faceSearch/faceSearch.query.js
@@ -19,6 +19,11 @@ class FaceSearchQuery 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)
}
@@ -37,13 +42,13 @@ class FaceSearchQuery extends Component {
<div className='uploadContainer'>
<div style={style}>
{image ? null : <img src="/assets/img/icon_camera.svg" />}
+ {result.loading && (
+ <div className='loading' style={style}>
+ <Loader />
+ </div>
+ )}
<UploadImage onUpload={this.upload.bind(this)} />
</div>
- {result.loading && (
- <div className='loading' style={style}>
- <Loader />
- </div>
- )}
</div>
<div className='cta'>
<h2>Search by Image</h2>