From: Ian Jackson Date: Wed, 31 Mar 2021 17:26:08 +0000 (+0100) Subject: script: Fix a (silent) JS error X-Git-Tag: otter-0.5.0~342 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5c526a52cf9002f937f90b45b33227ccc036f3fa;p=otter.git script: Fix a (silent) JS error When the api queue is empty this would spew a harmless error into the log. Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index f0e33e1e..46fc96d8 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -207,7 +207,7 @@ function api_check() { if (p == null) break; p.queued_moves--; if (p.queued_moves == 0) break; - } while(1); + } while (api_queue.length); api_posting = true; xhr_post_then('/_/api/'+meth, JSON.stringify(data), api_posted); }