mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
refactor: Remove foo_display fields on subs.
Also add a helpful comment explaining how these work.
This commit is contained in:
@@ -421,7 +421,13 @@ export function stream_settings(sub) {
|
||||
is_notification_setting: is_notification_setting(setting),
|
||||
};
|
||||
if (is_notification_setting(setting)) {
|
||||
ret.is_checked = sub[setting + "_display"] && !check_realm_setting[setting];
|
||||
// This block ensures we correctly display to users the
|
||||
// current state of stream-level notification settings
|
||||
// with a value of `null`, which inherit the user's global
|
||||
// notification settings for streams.
|
||||
ret.is_checked =
|
||||
stream_data.receives_notifications(sub.stream_id, setting) &&
|
||||
!check_realm_setting[setting];
|
||||
ret.is_disabled = ret.is_disabled || sub.is_muted;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -59,11 +59,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;
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
export function get_unmatched_streams_for_notification_settings() {
|
||||
|
||||
Reference in New Issue
Block a user