summaryrefslogtreecommitdiff
path: root/client/faceSearch/faceSearch.query.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/faceSearch/faceSearch.query.js')
-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>