From 143dfb62466ed9b2639a3e7d5fa1ae43af26a460 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 4 Nov 2013 14:16:28 -0500 Subject: [PATCH] messageTray: Simplify code If notificationRemoved, then mustClose is true, so we don't need to double-check for this. --- js/ui/messageTray.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 1e891faec..19599441a 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2373,7 +2373,6 @@ const MessageTray = new Lang.Class({ this._showNotification(); } } else if (this._notificationState == State.SHOWN) { - let pinned = this._pointerInNotification && !this._notificationRemoved; let expired = (this._userActiveWhileNotificationShown && this._notificationTimeoutId == 0 && !(this._notification.urgency == Urgency.CRITICAL) && @@ -2384,9 +2383,9 @@ const MessageTray = new Lang.Class({ if (mustClose) { let animate = hasNotifications && !this._notificationRemoved; this._hideNotification(animate); - } else if (pinned && !this._notification.expanded) { + } else if (this._pointerInNotification && !this._notification.expanded) { this._expandNotification(false); - } else if (pinned) { + } else if (this._pointerInNotification) { this._ensureNotificationFocused(); } }