mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 19:13:53 +00:00
retention: Remove checks for null value of realm_message_retention_days.
This commit removes "realm_message_retention_days === null" check from
the conditionals, as we had updated the backend to replace NULL value
with -1 in 7a03e2a.
This commit is contained in:
@@ -126,8 +126,7 @@ function get_property_value(property_name) {
|
||||
}
|
||||
|
||||
if (property_name === 'realm_message_retention_setting') {
|
||||
if (page_params.realm_message_retention_days === null ||
|
||||
page_params.realm_message_retention_days === settings_config.retain_message_forever) {
|
||||
if (page_params.realm_message_retention_days === settings_config.retain_message_forever) {
|
||||
return "retain_forever";
|
||||
}
|
||||
return "retain_for_period";
|
||||
|
||||
@@ -58,9 +58,8 @@ exports.get_retention_policy_text_for_subscription_type = function (sub) {
|
||||
let message_retention_days = sub.message_retention_days;
|
||||
// If both this stream and the organization-level policy are to retain forever,
|
||||
// there's no need to comment on retention policies when describing the stream.
|
||||
if ((page_params.realm_message_retention_days === -1 ||
|
||||
page_params.realm_message_retention_days === null)
|
||||
&& (sub.message_retention_days === null || sub.message_retention_days === -1)) {
|
||||
if (page_params.realm_message_retention_days === -1 &&
|
||||
(sub.message_retention_days === null || sub.message_retention_days === -1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,7 +79,7 @@ exports.get_retention_policy_text_for_subscription_type = function (sub) {
|
||||
|
||||
exports.get_display_text_for_realm_message_retention_setting = function () {
|
||||
const realm_message_retention_days = page_params.realm_message_retention_days;
|
||||
if (realm_message_retention_days === -1 || realm_message_retention_days === null) {
|
||||
if (realm_message_retention_days === -1) {
|
||||
return i18n.t("(forever)");
|
||||
}
|
||||
return i18n.t("(__message_retention_days__ days)", {message_retention_days: realm_message_retention_days});
|
||||
|
||||
Reference in New Issue
Block a user