From 938c38d9f0ca89f99449a38ecfcd8fd59267d49f Mon Sep 17 00:00:00 2001 From: Evan Theurer Date: Thu, 24 Sep 2015 16:02:04 +0200 Subject: [PATCH] Fix breaking change: Execute watched expressions only when the inputs change. See https://github.com/angular/angular.js/commit/fca6be71274e537c7df86ae9e27a3bd1597e9ffa. --- static/js/filters/displayname.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/filters/displayname.js b/static/js/filters/displayname.js index a76d8fa0..a8eb1230 100644 --- a/static/js/filters/displayname.js +++ b/static/js/filters/displayname.js @@ -31,7 +31,7 @@ define([], function() { var user_text = translation._("User"); var someone_text = translation._("Someone"); var me_text = translation._("Me"); - return function(id, me_ok) { + var filter = function(id, me_ok) { if (id === group_chat_id) { return ""; } @@ -62,6 +62,10 @@ define([], function() { return someone; } }; + // TODO(evan) Improve filter to reduce need for constant calling as name may change but id didn't. + // https://github.com/angular/angular.js/commit/fca6be71274e537c7df86ae9e27a3bd1597e9ffa + filter.$stateful = true; + return filter; }]; });