mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
compose banner: Consolidate two functions that clear success banners.
Previously notifications.clear_compose_notifications was used accross the codebase. Since introducing the new compose_banner.clear_message_sent_banners function, the two functions are similar enough that we can just use clear_message_sent_banners everywhere. This commit also moves scroll_to_message_banner_message_id to compose_banner.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import $ from "jquery";
|
||||
import _ from "lodash";
|
||||
|
||||
import * as compose_banner from "./compose_banner";
|
||||
import * as floating_recipient_bar from "./floating_recipient_bar";
|
||||
import * as hash_util from "./hash_util";
|
||||
import * as loading from "./loading";
|
||||
@@ -9,7 +10,6 @@ import * as message_lists from "./message_lists";
|
||||
import * as message_viewport from "./message_viewport";
|
||||
import * as narrow_banner from "./narrow_banner";
|
||||
import * as narrow_state from "./narrow_state";
|
||||
import * as notifications from "./notifications";
|
||||
import * as recent_topics_util from "./recent_topics_util";
|
||||
import * as unread from "./unread";
|
||||
import * as unread_ops from "./unread_ops";
|
||||
@@ -195,12 +195,12 @@ export function scroll_finished() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (notifications.scroll_to_message_banner_message_id !== null) {
|
||||
if (compose_banner.scroll_to_message_banner_message_id !== null) {
|
||||
const $message_row = message_lists.current.get_row(
|
||||
notifications.scroll_to_message_banner_message_id,
|
||||
compose_banner.scroll_to_message_banner_message_id,
|
||||
);
|
||||
if ($message_row.length > 0 && !message_viewport.is_message_below_viewport($message_row)) {
|
||||
notifications.clear_compose_notifications();
|
||||
compose_banner.clear_message_sent_banners();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user