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:
Steve Howell
2021-04-04 17:07:25 +00:00
committed by Tim Abbott
parent 99b177dc7d
commit 5624ed2afe
4 changed files with 10 additions and 5 deletions

View File

@@ -60,10 +60,6 @@ export function update_calculated_fields(sub) {
sub.preview_url = hash_util.by_stream_uri(sub.stream_id);
sub.is_old_stream = sub.stream_weekly_traffic !== null;
if (sub.rendered_description !== undefined) {
sub.rendered_description = sub.rendered_description.replace("<p>", "").replace("</p>", "");
}
// Apply the defaults for our notification settings for rendering.
for (const setting of settings_config.stream_specific_notification_settings) {
sub[setting + "_display"] = stream_data.receives_notifications(sub.stream_id, setting);