From 57bfd7c76649190cba7a81b6541ef0c26e15c198 Mon Sep 17 00:00:00 2001 From: Katelyn Perry Date: Fri, 31 Oct 2014 09:59:49 -0500 Subject: [PATCH] inflect number of socket errors --- lib/riemann/dash/public/subs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/riemann/dash/public/subs.js b/lib/riemann/dash/public/subs.js index 272d196..886f674 100644 --- a/lib/riemann/dash/public/subs.js +++ b/lib/riemann/dash/public/subs.js @@ -191,10 +191,15 @@ var subs = (function() { } var notifyErrors = function() { + var errorString; if (errorQueue.length == 0) { return; + } else if (errorQueue.length == 1) { + errorString = "error"; + } else { + errorString = "errors"; } - toastr.warning(errorQueue.length + " socket errors; check the server field above."); + toastr.warning(errorQueue.length + " socket " + errorString + "; check the server field above."); errorQueue.length = 0; }