Skip to content

Commit

Permalink
Fix 0 labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
pniedzwiedzinski committed Jan 10, 2019
1 parent 1cd4d2e commit e0b885f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import random
import uuid
import sys

import boto3
import botocore
Expand Down Expand Up @@ -140,6 +141,7 @@ def report_get():
session_id = request.args.get("key")

session.set(session_id, 'tmp/' + filename)
print("\033[92m-- User {} will label {} --\033[0m".format(session_id, filename))

return add_headers(jsonify({"data": data, "key": session_id}))

Expand Down
11 changes: 4 additions & 7 deletions src/components/AppleOrNot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ export default class AppleOrNot extends Component {
label = l => {
fetch(`${this.state.host}/label/?key=${this.state.key}&label=${l}`, {
method: "POST"
}).then(this.setState({ img: null, loading: true }));
}).then(() => {
this.setState({ img: null, loading: true });
this.getPhoto();
});
};

componentDidUpdate() {
if (this.state.loading) {
setTimeout(this.getPhoto(), 750);
}
}

render() {
return (
<>
Expand Down

0 comments on commit e0b885f

Please sign in to comment.