refactor: Move desktop_icon_count_display_values.

This commit is contained in:
Steve Howell 2021-03-22 12:14:33 +00:00 committed by Tim Abbott
parent a429ecbb1b
commit d644e42dc1
4 changed files with 19 additions and 20 deletions

View File

@ -10,7 +10,6 @@ import * as people from "./people";
import * as settings_bots from "./settings_bots";
import * as settings_config from "./settings_config";
import * as settings_data from "./settings_data";
import * as settings_notifications from "./settings_notifications";
import * as settings_panel_menu from "./settings_panel_menu";
import * as settings_sections from "./settings_sections";
import * as settings_toggle from "./settings_toggle";
@ -90,7 +89,7 @@ export function build_page() {
twenty_four_hour_time_values: settings_config.twenty_four_hour_time_values,
general_settings: settings_config.all_notifications().general_settings,
notification_settings: settings_config.all_notifications().settings,
desktop_icon_count_display_values: settings_notifications.desktop_icon_count_display_values,
desktop_icon_count_display_values: settings_config.desktop_icon_count_display_values,
show_push_notifications_tooltip: settings_config.all_notifications()
.show_push_notifications_tooltip,
display_settings: settings_config.get_all_display_settings(),

View File

@ -434,3 +434,18 @@ const map_language_to_playground_info = {
};
export const get_playground_info_for_languages = (lang) => map_language_to_playground_info[lang];
export const desktop_icon_count_display_values = {
messages: {
code: 1,
description: i18n.t("All unreads"),
},
notifiable: {
code: 2,
description: i18n.t("Private messages and mentions"),
},
none: {
code: 3,
description: i18n.t("None"),
},
};

View File

@ -11,21 +11,6 @@ import * as stream_data from "./stream_data";
import * as stream_edit from "./stream_edit";
import * as unread_ui from "./unread_ui";
export const desktop_icon_count_display_values = {
messages: {
code: 1,
description: i18n.t("All unreads"),
},
notifiable: {
code: 2,
description: i18n.t("Private messages and mentions"),
},
none: {
code: 3,
description: i18n.t("None"),
},
};
function rerender_ui() {
const unmatched_streams_table = $("#stream-specific-notify-table");
if (unmatched_streams_table.length === 0) {

View File

@ -2,7 +2,7 @@ import {FoldDict} from "./fold_dict";
import * as message_store from "./message_store";
import * as muting from "./muting";
import * as people from "./people";
import * as settings_notifications from "./settings_notifications";
import * as settings_config from "./settings_config";
import * as stream_data from "./stream_data";
import * as util from "./util";
@ -492,10 +492,10 @@ export function calculate_notifiable_count(res) {
const only_show_notifiable =
page_params.desktop_icon_count_display ===
settings_notifications.desktop_icon_count_display_values.notifiable.code;
settings_config.desktop_icon_count_display_values.notifiable.code;
const no_notifications =
page_params.desktop_icon_count_display ===
settings_notifications.desktop_icon_count_display_values.none.code;
settings_config.desktop_icon_count_display_values.none.code;
if (only_show_notifiable) {
// DESKTOP_ICON_COUNT_DISPLAY_NOTIFIABLE
new_message_count = res.mentioned_message_count + res.private_message_count;