refactor: Call compose_fade without triggers.

We are trying to phase out the trigger-event way
of telling modules to do something.

In this case we not only remove the indirection
of the event handler, but we also get to remove
`compose_fade` from the `ui_init` startup sequence.

This also has us update `compose_fade` outside
the loop, although that's only a theoretical
improvement, since I don't think `peer_add` events
every actually include multiple streams.

To make the dispatch tests a little flatter, I
added a one-line change to zjsunit to add
`make_stub` to `global`.

To manually test:
    * have Aaron reply to Denmark (keep compose box open)
    * have Iago add Hamlet to Denmark
    * have Hamlet unsubscribe
This commit is contained in:
Steve Howell
2020-06-12 12:39:14 +00:00
committed by Tim Abbott
parent 9d9342c2a5
commit b965766f87
6 changed files with 8 additions and 9 deletions

View File

@@ -239,11 +239,4 @@ exports.update_rendered_message_groups = function (message_groups, get_element)
}
};
exports.initialize = function () {
$(document).on('peer_subscribe.zulip peer_unsubscribe.zulip', function () {
exports.update_faded_users();
});
};
window.compose_fade = exports;