refactor: Avoid update_calculated_fields() calls.

This change should make live-update code less brittle,
or at least less cumbersome.

Instead of having to re-compute calculated fields for
every change to a stream message, we now just compute
the fields right before we render stream settings UI.
This commit is contained in:
Steve Howell
2021-04-04 18:00:22 +00:00
committed by Tim Abbott
parent 36632637dc
commit d50462568b
9 changed files with 24 additions and 60 deletions

View File

@@ -6,7 +6,6 @@ import {page_params} from "./page_params";
import * as peer_data from "./peer_data";
import * as people from "./people";
import * as settings_config from "./settings_config";
import * as stream_settings_data from "./stream_settings_data";
import * as stream_topic_history from "./stream_topic_history";
import * as util from "./util";
@@ -684,8 +683,6 @@ export function create_sub_from_server_data(attrs) {
sub.color = color_data.pick_color();
}
// TODO: Let stream settings code add these fields.
stream_settings_data.update_calculated_fields(sub);
clean_up_description(sub);
stream_info.set(sub.name, sub);