From 34927a6d96bd528cffcfc2ab108b96d0dcd1e010 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Fri, 8 Sep 2023 15:10:39 +0000 Subject: [PATCH] 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. --- web/src/narrow.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/narrow.js b/web/src/narrow.js index 90d83efd90..09d2cfede6 100644 --- a/web/src/narrow.js +++ b/web/src/narrow.js @@ -3,6 +3,7 @@ import $ from "jquery"; import {all_messages_data} from "./all_messages_data"; import * as blueslip from "./blueslip"; +import * as browser_history from "./browser_history"; import * as channel from "./channel"; import * as compose_actions from "./compose_actions"; 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 // happens from Recent Conversations view. if (raw_operators.length === 0) { - deactivate(coming_from_recent_view); + browser_history.go_to_location("#all_messages"); return; }