christopher commited on
Commit
8449525
·
1 Parent(s): 8e397eb

Update static/app.js

Browse files
Files changed (1) hide show
  1. static/app.js +2 -0
static/app.js CHANGED
@@ -18,6 +18,8 @@ function updateInfo() {
18
  }
19
 
20
  function search() {
 
 
21
  document.getElementById('results').innerHTML = '<p>Searching...</p>';
22
  fetch('/search', {
23
  method: 'POST',
 
18
  }
19
 
20
  function search() {
21
+ let pos = board.position();
22
+ if (Object.keys(pos).length < 3) { document.getElementById('results').innerHTML = '<p>Add at least 3 pieces to search.</p>'; return; }
23
  document.getElementById('results').innerHTML = '<p>Searching...</p>';
24
  fetch('/search', {
25
  method: 'POST',