Commit Graph

5 Commits

Author SHA1 Message Date
Tim Abbott d98580ab14 compose_state: Remove incorrect recipient_has_topics helper.
This function was introduced in
99d1c5a1f3 and always has the opposite
value from what its name suggests. It worked OK because the caller
also expected it to have an incorrect value.

It's cleaner in this context to just use the `stream_id` helper, so
just delete the bad code and use that.

Fix the docstring comment having been incorrectly pushed down while
we're addressing this.
2024-03-11 16:31:58 -07:00
N-Shar-ma 2952f0f44f refactor: Initialise state variables to undefined instead of false.
For compose state variables `last_focused_compose_type_input` and
`message_type` that are assigned non-boolean values on user interaction,
`undefined` is the semantically better choice than `false` for
initialisation, to avoid incorrect boolean implications.
2024-01-14 18:11:26 -08:00
Anders Kaseorg 3d55e7ef10 eslint: Fix @typescript-eslint/prefer-nullish-coalescing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-23 15:36:05 -08:00
N-Shar-ma 4610c1a257 compose: Keep track of the last compose type textarea focused on.
This is a prep commit for the next commit, which will quote a message
into the last focused compose type textarea, which we track in a new
`compose_state` variable in this commit.
2023-11-21 11:20:13 -08:00
Anders Kaseorg b3fa7b15fc compose_state: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 14:06:04 -07:00