]> git.cworth.org Git - lmno.games/commitdiff
Add some explanatory text when there aren't enough categories/votes
authorCarl Worth <cworth@cworth.org>
Mon, 29 Jun 2020 22:07:26 +0000 (15:07 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 29 Jun 2020 22:08:26 +0000 (15:08 -0700)
Encouraging the players to make more of either, so that the game will
make some progress.

empathy/empathy.jsx

index 001dcd5eeeb5ac3f943d368f971f8a78d19981d3..37fd910e75eeca154e304b08dda107414456a9dc 100644 (file)
@@ -437,8 +437,28 @@ const LetsPlay = React.memo(props => {
   const max_votes = props.prompts.reduce(
     (max_so_far, v) => Math.max(max_so_far, v.votes.length), 0);
 
   const max_votes = props.prompts.reduce(
     (max_so_far, v) => Math.max(max_so_far, v.votes.length), 0);
 
-  if (max_votes < quorum)
-    return null;
+  if (max_votes < quorum) {
+    let text = `Before we play, we should collect a bit
+                more information about what category would
+                be interesting for this group. So, either
+                type a new category option above, or else`;
+    if (props.prompts.length) {
+      if (props.prompts.length > 1)
+        text += " vote on some of the categories below.";
+      else
+        text += " vote on the category below.";
+    } else {
+      text += " wait for others to submit, and then vote on them below.";
+    }
+
+    return (
+      <div className="before-we-play">
+        <p>
+          {text}
+        </p>
+      </div>
+    );
+  }
 
   const candidates = props.prompts.filter(p => p.votes.length >= max_votes);
   const index = Math.floor(Math.random() * candidates.length);
 
   const candidates = props.prompts.filter(p => p.votes.length >= max_votes);
   const index = Math.floor(Math.random() * candidates.length);