mirror of https://github.com/zulip/zulip.git
typing: Check for valid user IDs when setting typing recipient.
Before sending typing notifications to the server, make sure that the user has set at least one valid user pill in the compose box recipient bar.
This commit is contained in:
parent
ad1d8a204f
commit
efc6c70d3b
|
@ -111,10 +111,15 @@ function notify_server_stop(to: Recipient): void {
|
|||
export function get_recipient(): Recipient | null {
|
||||
const message_type = compose_state.get_message_type();
|
||||
if (message_type === "private") {
|
||||
const user_ids = get_user_ids_array();
|
||||
// compose box with no valid user pills.
|
||||
if (user_ids === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
message_type: "direct",
|
||||
notification_event_type: "typing",
|
||||
ids: get_user_ids_array()!,
|
||||
ids: user_ids,
|
||||
};
|
||||
}
|
||||
if (message_type === "stream") {
|
||||
|
|
Loading…
Reference in New Issue