mirror of https://github.com/zulip/zulip.git
typing: Fix "Missing stream_id" server error.
This commit fixes an error where composing a message with no stream selected resulted in making a POST request to '/typing' with stream_id as undefined which resulted in a "Missing server_id" error. We no longer make a POST request if the stream is not selected.
This commit is contained in:
parent
1a5c475910
commit
f023a11d01
|
@ -119,7 +119,11 @@ export function get_recipient(): Recipient | null {
|
|||
}
|
||||
if (message_type === "stream") {
|
||||
const stream_name = compose_state.stream_name();
|
||||
const stream_id = stream_data.get_stream_id(stream_name)!;
|
||||
const stream_id = stream_data.get_stream_id(stream_name);
|
||||
if (stream_id === undefined) {
|
||||
// compose box with no stream selected.
|
||||
return null;
|
||||
}
|
||||
const topic = compose_state.topic();
|
||||
return {
|
||||
message_type: "stream",
|
||||
|
|
Loading…
Reference in New Issue