Skip to content

Commit

Permalink
notifications: Avoid misleading href on scroll to bottom notice.
Browse files Browse the repository at this point in the history
  • Loading branch information
timabbott committed Feb 3, 2023
1 parent dd95f79 commit a8ce7df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions static/js/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ export function notify_local_mixes(messages, need_user_to_scroll) {

let reason = get_local_notify_mix_reason(message);

const above_composebox_narrow_url = get_above_composebox_narrow_url(message);
const link_msg_id = message.id;

if (!reason) {
Expand All @@ -622,7 +621,8 @@ export function notify_local_mixes(messages, need_user_to_scroll) {
notify_above_composebox(
reason,
"compose_notification_scroll_to_message",
above_composebox_narrow_url,
// Don't display a URL on hover for the "Scroll to bottom" link.
null,
link_msg_id,
link_text,
);
Expand All @@ -634,6 +634,7 @@ export function notify_local_mixes(messages, need_user_to_scroll) {
continue;
}

const above_composebox_narrow_url = get_above_composebox_narrow_url(message);
const link_class = "compose_notification_narrow_by_topic";
const link_text = $t(
{defaultMessage: "Narrow to {message_recipient}"},
Expand Down
2 changes: 1 addition & 1 deletion static/templates/compose_banner/message_sent_banner.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="compose-notifications-content">
{{note}} {{#if link_class}}<a href="{{above_composebox_narrow_url}}" class="{{link_class}}" data-message-id="{{link_msg_id}}">{{link_text}}</a>{{/if}}
{{note}} {{#if link_class}}<a {{#if above_composebox_narrow_url}}href="{{above_composebox_narrow_url}}"{{/if}} class="{{link_class}}" data-message-id="{{link_msg_id}}">{{link_text}}</a>{{/if}}
<button type="button" class="out-of-view-notification-close close">&times;</button>
</div>

0 comments on commit a8ce7df

Please sign in to comment.