narrow: Don't call deactivate directly.

As stated in the deactivate function comments, it should be called
via `browser_history.go_to_location` so that all the correct
functions are called like recent view being hidden.

This fixes a bug where searching for nothing results in activating
all messages narrow without hiding recent view. Now, all messages
should be activated as expected.
This commit is contained in:
Aman Agrawal 2023-09-08 15:10:39 +00:00 committed by Tim Abbott
parent 9959c48697
commit 34927a6d96
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import $ from "jquery";
import {all_messages_data} from "./all_messages_data"; import {all_messages_data} from "./all_messages_data";
import * as blueslip from "./blueslip"; import * as blueslip from "./blueslip";
import * as browser_history from "./browser_history";
import * as channel from "./channel"; import * as channel from "./channel";
import * as compose_actions from "./compose_actions"; import * as compose_actions from "./compose_actions";
import * as compose_banner from "./compose_banner"; import * as compose_banner from "./compose_banner";
@ -199,7 +200,7 @@ export function activate(raw_operators, opts) {
// no operators were specified. Take us to all messages when this // no operators were specified. Take us to all messages when this
// happens from Recent Conversations view. // happens from Recent Conversations view.
if (raw_operators.length === 0) { if (raw_operators.length === 0) {
deactivate(coming_from_recent_view); browser_history.go_to_location("#all_messages");
return; return;
} }