mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
refactor: Extract stream_data.clean_up_description().
We use this in the few places where update_calculated_fields() could plausibly be dealing with a new rendered description.
This commit is contained in:
@@ -631,6 +631,12 @@ export function create_streams(streams) {
|
||||
}
|
||||
}
|
||||
|
||||
export function clean_up_description(sub) {
|
||||
if (sub.rendered_description !== undefined) {
|
||||
sub.rendered_description = sub.rendered_description.replace("<p>", "").replace("</p>", "");
|
||||
}
|
||||
}
|
||||
|
||||
export function create_sub_from_server_data(attrs) {
|
||||
if (!attrs.stream_id) {
|
||||
// fail fast
|
||||
@@ -680,6 +686,7 @@ export function create_sub_from_server_data(attrs) {
|
||||
|
||||
// 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);
|
||||
subs_by_stream_id.set(sub.stream_id, sub);
|
||||
|
||||
Reference in New Issue
Block a user