compose: Fix buggy recipient id code.

`selected_recipient_id` is supposed to be an id,
not a stream name. This function is currently
only ever called for direct messages, so there's
no present user-facing bug.
This commit is contained in:
evykassirer 2023-05-25 17:37:22 -07:00 committed by Tim Abbott
parent 91d32d9f16
commit afd703fe77

View File

@ -97,11 +97,9 @@ export function set_stream_name(stream_name) {
compose_recipient.set_selected_recipient_id(stream_id);
}
export function set_compose_recipient_id(value) {
let recipient_id = compose_recipient.DIRECT_MESSAGE_ID;
if (typeof value === "number") {
// value is stream name
recipient_id = sub_store.maybe_get_stream_name(value) || "";
export function set_compose_recipient_id(recipient_id) {
if (typeof recipient_id !== "number") {
recipient_id = compose_recipient.DIRECT_MESSAGE_ID;
}
compose_recipient.set_selected_recipient_id(recipient_id);
}