From 4230b11f829eab0b9c7afb50fcae2384a14601f5 Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 6 Feb 2017 18:22:09 -0800 Subject: [PATCH] Support future compatibility for new timer options If some future client ever sends us an arbitrary timer value which we do not currently support, present it as a duration in seconds in timer update messages and ui, where we would otherwise have rendered nothing, e.g., "You set the timer to ." // FREEBIE --- js/expiring_messages.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/expiring_messages.js b/js/expiring_messages.js index ab7b0ce4..4989ee12 100644 --- a/js/expiring_messages.js +++ b/js/expiring_messages.js @@ -32,6 +32,9 @@ } var o = this.findWhere({seconds: seconds}); if (o) { return o.getName(); } + else { + return [seconds, 'seconds'].join(' '); + } }, getAbbreviated: function(seconds) { if (!seconds) { @@ -39,6 +42,9 @@ } var o = this.findWhere({seconds: seconds}); if (o) { return o.getAbbreviated(); } + else { + return [seconds, 's'].join(''); + } } }))([ [ 0, 'seconds' ],