From 5c526a52cf9002f937f90b45b33227ccc036f3fa Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 31 Mar 2021 18:26:08 +0100 Subject: [PATCH] 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 --- templates/script.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.30.2