From d386da0cff413ca9148aa1866dc0c1b7320be34d Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 8 Apr 2014 17:08:57 +0100 Subject: [PATCH] onStat publishes a "complete" event when the number of active clients falls to zero. This enables us to make a "search is complete" widget, which fixes bugs MKWS-48 and MKWS-49. --- src/mkws-team.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mkws-team.js b/src/mkws-team.js index ee18f1b..4447457 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -115,8 +115,9 @@ function team($, teamName) { } function onStat(data) { - log("stat"); queue("stat").publish(data); + if (parseInt(data.activeclients[0], 10) === 0) + queue("complete").publish(parseInt(data.hits[0], 10)); } function onTerm(data) { -- 1.7.10.4