mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
compose_state: Use stream_name() and topic() universally.
This change ensures that every call to find the stream name or topic in the composebox is calling compose_state functions instead of directly taking a value from an HTML element specified by a classname. This has better code readability and abstracts away the classname, and also makes it easier to change which classname we use (which will be happening in an upcoming change as part of switching the stream name field to a dropdown). Note that this change means that the stream name will always be trimmed, whereas before it was whatever the user had written even if it had trailing whitespace. This shouldn't be an issue as far as we (me + Tim) can tell, and also it will become irrelevant as soon as the dropdown changes land.
This commit is contained in:
@@ -268,8 +268,8 @@ export function update_placeholder_text() {
|
||||
|
||||
const opts = {
|
||||
message_type: compose_state.get_message_type(),
|
||||
stream: $("#stream_message_recipient_stream").val(),
|
||||
topic: $("#stream_message_recipient_topic").val(),
|
||||
stream: compose_state.stream_name(),
|
||||
topic: compose_state.topic(),
|
||||
private_message_recipient: compose_pm_pill.get_emails(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user