zulip/web/src/compose_fade_users.js
Anders Kaseorg c1675913a2 web: Move web app to ‘web’ directory.
Ever since we started bundling the app with webpack, there’s been less
and less overlap between our ‘static’ directory (files belonging to
the frontend app) and Django’s interpretation of the ‘static’
directory (files served directly to the web).

Split the app out to its own ‘web’ directory outside of ‘static’, and
remove all the custom collectstatic --ignore rules.  This makes it
much clearer what’s actually being served to the web, and what’s being
bundled by webpack.  It also shrinks the release tarball by 3%.

Signed-off-by: Anders Kaseorg <[email protected]>
2023-02-23 16:04:17 -08:00

34 lines
843 B
JavaScript

import * as compose_fade_helper from "./compose_fade_helper";
import * as people from "./people";
function update_user_row_when_fading(li, conf) {
const user_id = conf.get_user_id(li);
const would_receive = compose_fade_helper.would_receive_message(user_id);
if (would_receive || people.is_my_user_id(user_id)) {
conf.unfade(li);
} else {
conf.fade(li);
}
}
export function fade_users(items, conf) {
for (const li of items) {
update_user_row_when_fading(li, conf);
}
}
export function display_users_normally(items, conf) {
for (const li of items) {
conf.unfade(li);
}
}
export function update_user_info(items, conf) {
if (compose_fade_helper.want_normal_display()) {
display_users_normally(items, conf);
} else {
fade_users(items, conf);
}
}