mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
compose: Show topic resolve warning only when compose is nonempty.
The resolve topic warning can feel like clutter in the event that the compose box is empty (which often occurs when the user has no intent to send a message), so we configure the validation logic to only display the notice when the compose box is non-empty. We take some care to minimize work the function is doing, beacuse it is called on every keystroke in the compose box. Fixes: #21155.
This commit is contained in:
@@ -291,7 +291,7 @@ export function start(msg_type, opts) {
|
||||
show_box(msg_type, opts);
|
||||
|
||||
// Show a warning if topic is resolved
|
||||
compose_validate.warn_if_topic_resolved();
|
||||
compose_validate.warn_if_topic_resolved(true);
|
||||
|
||||
// Reset the `max-height` property of `compose-textarea` so that the
|
||||
// compose-box do not cover the last messages of the current stream
|
||||
@@ -464,7 +464,7 @@ export function on_topic_narrow() {
|
||||
// See #3300 for context--a couple users specifically asked for
|
||||
// this convenience.
|
||||
compose_state.topic(narrow_state.topic());
|
||||
compose_validate.warn_if_topic_resolved();
|
||||
compose_validate.warn_if_topic_resolved(true);
|
||||
compose_fade.set_focused_recipient("stream");
|
||||
compose_fade.update_message_list();
|
||||
$("#compose-textarea").trigger("focus").trigger("select");
|
||||
|
||||
Reference in New Issue
Block a user