From ed0abb8a537d51d04e1b22d44f7f8ceaeba88fc6 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 7 Jan 2019 23:34:03 +0000 Subject: [PATCH] minor: Move code around for setting link id/text/class. We don't need to compute these vars if we early exit. --- static/js/notifications.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/static/js/notifications.js b/static/js/notifications.js index c3c077ca10..89ec3628d4 100644 --- a/static/js/notifications.js +++ b/static/js/notifications.js @@ -613,10 +613,6 @@ exports.notify_local_mixes = function (messages) { blueslip.warn('We did not expect messages sent by others to get here'); return; } - var link_msg_id = message.id; - var link_class = "compose_notification_narrow_by_topic"; - var link_text = i18n.t("Narrow to __- message_recipient__", - {message_recipient: get_message_header(message)}); var reason = exports.get_local_notify_mix_reason(message); @@ -634,6 +630,11 @@ exports.notify_local_mixes = function (messages) { return; } + var link_msg_id = message.id; + var link_class = "compose_notification_narrow_by_topic"; + var link_text = i18n.t("Narrow to __- message_recipient__", + {message_recipient: get_message_header(message)}); + exports.notify_above_composebox(reason, link_class, link_msg_id, link_text); }); };