stream_id: Replace empty string with undefined.

This commit also limits `stream_bar.decorate` to only
be able to be called for stream messages, since it's
an undefined string_id is no longer a sign that
you're dealing with a DM.
This commit is contained in:
evykassirer
2023-09-26 11:28:39 -07:00
committed by Tim Abbott
parent 07e6bcda7c
commit 77fc836edf
14 changed files with 28 additions and 28 deletions

View File

@@ -79,7 +79,7 @@ function get_stream_id_for_textarea($textarea) {
return Number.parseInt(stream_id_str, 10);
}
return compose_state.stream_id() || undefined;
return compose_state.stream_id();
}
export function warn_if_private_stream_is_linked(linked_stream, $textarea) {
@@ -480,7 +480,7 @@ export function validate_stream_message_address_info(stream_name) {
function validate_stream_message(scheduling_message) {
const stream_id = compose_state.stream_id();
const $banner_container = $("#compose_banners");
if (stream_id === "") {
if (stream_id === undefined) {
compose_banner.show_error_message(
$t({defaultMessage: "Please specify a stream."}),
compose_banner.CLASSNAMES.missing_stream,