messageTray: Correctly show the icon on a notification stack

An actor is removed from its parent after it emits the destroy signal,
so we can't just check if the notification stack has more than one
notification -- we need to check if there's a notification there
that is not the current one.

This was causing spew in the form of:

    "this.notificationStack.get_children()[0]._delegate.setIconVisible
     is not a function"
This commit is contained in:
Jasper St. Pierre 2012-02-16 17:23:16 -05:00
parent 36c3ce9333
commit fd99d13f04

View File

@ -1327,8 +1327,9 @@ const SummaryItem = new Lang.Class({
} }
} }
if (this.notificationStack.get_children().length > 0) let firstNotification = this._stackedNotifications[0];
this.notificationStack.get_children()[0]._delegate.setIconVisible(true); if (firstNotification)
firstNotification.notification.setIconVisible(true);
} }
}); });
Signals.addSignalMethods(SummaryItem.prototype); Signals.addSignalMethods(SummaryItem.prototype);