Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

sub_store: Extract StreamSpecificNotificationSettings type.

Anders Kaseorg77599d4db110
diff --git a/static/js/settings_config.ts b/static/js/settings_config.ts
index 92d6fd4d56e..b1f6ace5a75 100644
--- a/static/js/settings_config.ts
+++ b/static/js/settings_config.ts
@@ -3,6 +3,7 @@ import Handlebars from "handlebars/runtime";
import {$t, $t_html} from "./i18n";
import {page_params} from "./page_params";
import type {RealmDefaultSettings} from "./realm_user_settings_defaults";
+import type {StreamSpecificNotificationSettings} from "./sub_store";
import type {
PmNotificationSettings,
StreamNotificationSettings,
@@ -567,7 +568,7 @@ export const general_notifications_table_labels = {
},
};
-export const stream_specific_notification_settings = [
+export const stream_specific_notification_settings: (keyof StreamSpecificNotificationSettings)[] = [
"desktop_notifications",
"audible_notifications",
"push_notifications",
diff --git a/static/js/sub_store.ts b/static/js/sub_store.ts
index 0d14b0664c1..e947f71a080 100644
--- a/static/js/sub_store.ts
+++ b/static/js/sub_store.ts
@@ -22,19 +22,22 @@ export type Stream = {
stream_post_policy: StreamPostPolicy;
};
-export type StreamSubscription = Stream & {
+export type StreamSpecificNotificationSettings = {
audible_notifications: boolean | null;
- color: string;
desktop_notifications: boolean | null;
- email_address: string;
email_notifications: boolean | null;
+ push_notifications: boolean | null;
+ wildcard_mentions_notify: boolean | null;
+};
+
+export type StreamSubscription = (Stream & StreamSpecificNotificationSettings) & {
+ color: string;
+ email_address: string;
in_home_view: boolean;
is_muted: boolean;
pin_to_top: boolean;
- push_notifications: boolean | null;
stream_weekly_traffic: number | null;
subscribers?: number[];
- wildcard_mentions_notify: boolean | null;
};
const subs_by_stream_id = new Map<number, StreamSubscription>();