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.
This commit is contained in:
Florian Müllner 2011-07-13 22:23:03 +02:00
parent 86818e9c52
commit a92b7342ba

View File

@ -949,14 +949,14 @@ Source.prototype = {
if (isNaN(parseInt(count))) if (isNaN(parseInt(count)))
throw new Error("Invalid notification count: " + count); throw new Error("Invalid notification count: " + count);
if (this._actorDestroyed)
return;
this._counterBin.visible = visible; this._counterBin.visible = visible;
this._counterLabel.set_text(count.toString()); this._counterLabel.set_text(count.toString());
}, },
_updateCount: function() { _updateCount: function() {
if (this._actorDestroyed)
return;
let count = this.notifications.length; let count = this.notifications.length;
this._setCount(count, count > 1); this._setCount(count, count > 1);
}, },