mirror of https://github.com/zulip/zulip.git
compose_state: Add is_topic_field_empty().
This is required for adding a narrow-to-recipient button which we do not want to show when topic field is empty.
This commit is contained in:
parent
d363ea6158
commit
1c0368c402
|
@ -20,3 +20,11 @@ run_test("private_message_recipient", ({override}) => {
|
|||
compose_state.private_message_recipient("fred@fred.org");
|
||||
assert.equal(compose_state.private_message_recipient(), "fred@fred.org");
|
||||
});
|
||||
|
||||
run_test("is_topic_field_empty", () => {
|
||||
compose_state.topic("");
|
||||
assert.equal(compose_state.is_topic_field_empty(), true);
|
||||
|
||||
compose_state.topic("foo");
|
||||
assert.equal(compose_state.is_topic_field_empty(), false);
|
||||
});
|
||||
|
|
|
@ -84,3 +84,7 @@ export function private_message_recipient(value) {
|
|||
export function has_message_content() {
|
||||
return message_content() !== "";
|
||||
}
|
||||
|
||||
export function is_topic_field_empty() {
|
||||
return topic() === "";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue