Set kudos to null if no answer is starred
authorCarl Worth <cworth@cworth.org>
Mon, 29 Jun 2020 15:06:54 +0000 (08:06 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 29 Jun 2020 15:06:54 +0000 (08:06 -0700)
This fixes the bug we saw last night where nobody could submit judging
results until they had starred at least one item.

empathy/empathy.jsx

index 5782b7879076bdd8812bccffc58a281b63760d5b..bc70a85f0df820b34c552de473df8d971352f1b4 100644 (file)
@@ -503,7 +503,7 @@ class Ambiguities extends React.PureComponent {
     const response = await fetch_post_json(
       `judged/${this.props.prompt.id}`,{
         word_groups: this.state.word_sets.map(set => Array.from(set)),
-        kudos: Array.from(this.state.starred)
+        kudos: this.state.starred ? Array.from(this.state.starred) : null
       }
     );