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:
sahil839
2020-06-26 03:14:45 +05:30
committed by Tim Abbott
parent cc991f58bd
commit ca8f907eaf
2 changed files with 4 additions and 6 deletions

View File

@@ -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";

View File

@@ -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});