compose_closed_ui: Show default label for empty narrows.

The default label for empty narrows depends on whether it's a
stream/topic narrow or a PMs narrow.

We leave some default text in compose.hbs for reply label
because it take some time for the js to display the
correct label.
This commit is contained in:
Aman Agrawal
2021-05-10 15:21:20 +00:00
committed by Tim Abbott
parent 98b9c7284e
commit 0d8a7efa09
8 changed files with 64 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import * as fenced_code from "../shared/js/fenced_code";
import * as channel from "./channel";
import * as common from "./common";
import * as compose from "./compose";
import * as compose_actions from "./compose_actions";
import * as compose_fade from "./compose_fade";
import * as compose_pm_pill from "./compose_pm_pill";
import * as compose_state from "./compose_state";
@@ -314,7 +315,7 @@ export function respond_to_message(opts) {
!narrow_state.narrowed_by_stream_reply() &&
!narrow_state.narrowed_by_topic_reply()
) {
compose.nonexistent_stream_reply_error();
start("stream", {trigger: "empty_narrow_compose"});
return;
}
const current_filter = narrow_state.filter();
@@ -323,7 +324,7 @@ export function respond_to_message(opts) {
const first_operand = first_term.operand;
if (first_operator === "stream" && !stream_data.is_subscribed(first_operand)) {
compose.nonexistent_stream_reply_error();
start("stream", {trigger: "empty_narrow_compose"});
return;
}