mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
narrow: Clarify first parameter to deactivate.
This previous parameter name was inaccurate, since that's not what the caller is actually asserting for us.
This commit is contained in:
@@ -55,7 +55,7 @@ function show_all_message_view() {
|
|||||||
const coming_from_recent_view = maybe_hide_recent_view();
|
const coming_from_recent_view = maybe_hide_recent_view();
|
||||||
const coming_from_inbox = maybe_hide_inbox();
|
const coming_from_inbox = maybe_hide_inbox();
|
||||||
const is_actively_scrolling = message_scroll.is_actively_scrolling();
|
const is_actively_scrolling = message_scroll.is_actively_scrolling();
|
||||||
narrow.deactivate(!(coming_from_recent_view || coming_from_inbox), is_actively_scrolling);
|
narrow.deactivate(coming_from_recent_view || coming_from_inbox, is_actively_scrolling);
|
||||||
// We need to maybe scroll to the selected message
|
// We need to maybe scroll to the selected message
|
||||||
// once we have the proper viewport set up
|
// once we have the proper viewport set up
|
||||||
setTimeout(message_viewport.maybe_scroll_to_selected, 0);
|
setTimeout(message_viewport.maybe_scroll_to_selected, 0);
|
||||||
|
|||||||
@@ -970,7 +970,7 @@ function handle_post_narrow_deactivate_processes(msg_list) {
|
|||||||
message_feed_top_notices.update_top_of_narrow_notices(msg_list);
|
message_feed_top_notices.update_top_of_narrow_notices(msg_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deactivate(coming_from_all_messages = true, is_actively_scrolling = false) {
|
export function deactivate(message_feed_previously_hidden = false, is_actively_scrolling = false) {
|
||||||
// NOTE: Never call this function independently,
|
// NOTE: Never call this function independently,
|
||||||
// always use browser_history.go_to_location("#all_messages") to
|
// always use browser_history.go_to_location("#all_messages") to
|
||||||
// activate All message narrow.
|
// activate All message narrow.
|
||||||
@@ -989,7 +989,7 @@ export function deactivate(coming_from_all_messages = true, is_actively_scrollin
|
|||||||
search.clear_search_form();
|
search.clear_search_form();
|
||||||
// Both All messages and Recent Conversations have `undefined` filter.
|
// Both All messages and Recent Conversations have `undefined` filter.
|
||||||
// Return if already in the All message narrow.
|
// Return if already in the All message narrow.
|
||||||
if (narrow_state.filter() === undefined && coming_from_all_messages) {
|
if (narrow_state.filter() === undefined && !message_feed_previously_hidden) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
blueslip.debug("Unnarrowed");
|
blueslip.debug("Unnarrowed");
|
||||||
@@ -997,7 +997,7 @@ export function deactivate(coming_from_all_messages = true, is_actively_scrollin
|
|||||||
if (is_actively_scrolling) {
|
if (is_actively_scrolling) {
|
||||||
// There is no way to intercept in-flight scroll events, and they will
|
// There is no way to intercept in-flight scroll events, and they will
|
||||||
// cause you to end up in the wrong place if you are actively scrolling
|
// cause you to end up in the wrong place if you are actively scrolling
|
||||||
// on an unnarrow. Wait a bit and try again once the scrolling is over.
|
// on an unnarrow. Wait a bit and try again once the scrolling is likely over.
|
||||||
setTimeout(deactivate, 50);
|
setTimeout(deactivate, 50);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user