mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
compose: Distinguish get_message_type() from composing().
We now only call compose_state.composing() in a boolean context, where we simply care whether or not the compose box is open. The function now also returns true/false. Callers who need to know the actual message type (e.g. "stream" or "private") now call compose_state.get_message_type().
This commit is contained in:
@@ -13,14 +13,9 @@ exports.get_message_type = function () {
|
||||
};
|
||||
|
||||
exports.composing = function () {
|
||||
// For legacy reasons, this is the same as get_message_type.
|
||||
// Most callers use this in a boolean context, but there are
|
||||
// some stragglers that inspect the string value.
|
||||
//
|
||||
// TODO: Fix callers who care about stream/private to use
|
||||
// get_message_type(), and then convert this to return
|
||||
// `!!message_type` or something like that.
|
||||
return message_type;
|
||||
// This is very similar to get_message_type(), but it returns
|
||||
// a boolean.
|
||||
return !!message_type;
|
||||
};
|
||||
|
||||
function get_or_set(fieldname, keep_leading_whitespace) {
|
||||
|
||||
Reference in New Issue
Block a user