From a92b7342bac452f84937d9d667e4145faddb381e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 13 Jul 2011 22:23:03 +0200 Subject: [PATCH] message-tray: Move check for _actorDestroyed into _setCount() As _updateCount has been designed to be overwritable by subclasses, move the check for _actorDestroyed into _setCount(), to fix the problem described in commit 5f6ac33d5 in derived types as well. --- js/ui/messageTray.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index bf72a0f58..41475c106 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -949,14 +949,14 @@ Source.prototype = { if (isNaN(parseInt(count))) throw new Error("Invalid notification count: " + count); + if (this._actorDestroyed) + return; + this._counterBin.visible = visible; this._counterLabel.set_text(count.toString()); }, _updateCount: function() { - if (this._actorDestroyed) - return; - let count = this.notifications.length; this._setCount(count, count > 1); },