mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
home: Get enable_stream_desktop_notifications from register_ret.
This commit is contained in:
@@ -49,7 +49,7 @@ i18n.init({
|
||||
avatar_url: "http://example.com",
|
||||
left_side_userlist: false,
|
||||
twenty_four_hour_time: false,
|
||||
stream_desktop_notifications_enabled: false,
|
||||
enable_stream_desktop_notifications: false,
|
||||
enable_stream_sounds: false,
|
||||
desktop_notifications_enabled: false,
|
||||
enable_sounds: false,
|
||||
|
||||
@@ -779,7 +779,7 @@ function render(template_name, args) {
|
||||
|
||||
(function settings_tab() {
|
||||
var page_param_checkbox_options = {
|
||||
stream_desktop_notifications_enabled: true,
|
||||
enable_stream_desktop_notifications: true,
|
||||
enable_stream_sounds: true, desktop_notifications_enabled: true,
|
||||
enable_sounds: true, enable_offline_email_notifications: true,
|
||||
enable_offline_push_notifications: true, enable_online_push_notifications: true,
|
||||
|
||||
@@ -636,7 +636,7 @@ exports.handle_global_notification_updates = function (notification_name, settin
|
||||
// for a given message. These settings do not affect whether or not a
|
||||
// particular stream should receive notifications.
|
||||
if (notification_name === "enable_stream_desktop_notifications") {
|
||||
page_params.stream_desktop_notifications_enabled = setting;
|
||||
page_params.enable_stream_desktop_notifications = setting;
|
||||
} else if (notification_name === "enable_stream_sounds") {
|
||||
page_params.enable_stream_sounds = setting;
|
||||
} else if (notification_name === "enable_desktop_notifications") {
|
||||
|
||||
@@ -16,7 +16,7 @@ exports.set_up = function () {
|
||||
// Stream notification settings.
|
||||
|
||||
if (result.enable_stream_desktop_notifications !== undefined) {
|
||||
page_params.stream_desktop_notifications_enabled =
|
||||
page_params.enable_stream_desktop_notifications =
|
||||
result.enable_stream_desktop_notifications;
|
||||
}
|
||||
if (result.enable_stream_sounds !== undefined) {
|
||||
@@ -142,7 +142,7 @@ exports.set_up = function () {
|
||||
};
|
||||
|
||||
function _update_page() {
|
||||
$("#enable_stream_desktop_notifications").prop('checked', page_params.stream_desktop_notifications_enabled);
|
||||
$("#enable_stream_desktop_notifications").prop('checked', page_params.enable_stream_desktop_notifications);
|
||||
$("#enable_stream_sounds").prop('checked', page_params.enable_stream_sounds);
|
||||
$("#enable_desktop_notifications").prop('checked', page_params.desktop_notifications_enabled);
|
||||
$("#enable_sounds").prop('checked', page_params.enable_sounds);
|
||||
|
||||
@@ -278,7 +278,7 @@ exports.create_sub_from_server_data = function (stream_name, attrs) {
|
||||
newly_subscribed: false,
|
||||
in_home_view: true,
|
||||
invite_only: false,
|
||||
desktop_notifications: page_params.stream_desktop_notifications_enabled,
|
||||
desktop_notifications: page_params.enable_stream_desktop_notifications,
|
||||
audible_notifications: page_params.enable_stream_sounds,
|
||||
description: '',
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" class="inline-block" name="enable_stream_desktop_notifications"
|
||||
id="enable_stream_desktop_notifications"
|
||||
{{#if page_params.stream_desktop_notifications_enabled}}
|
||||
{{#if page_params.enable_stream_desktop_notifications}}
|
||||
checked="checked"
|
||||
{{/if}} />
|
||||
<span></span>
|
||||
|
||||
@@ -63,6 +63,7 @@ class HomeTest(ZulipTestCase):
|
||||
"enable_offline_push_notifications",
|
||||
"enable_online_push_notifications",
|
||||
"enable_sounds",
|
||||
"enable_stream_desktop_notifications",
|
||||
"enable_stream_sounds",
|
||||
"enter_sends",
|
||||
"first_in_realm",
|
||||
@@ -133,7 +134,6 @@ class HomeTest(ZulipTestCase):
|
||||
"server_inline_url_embed_preview",
|
||||
"server_uri",
|
||||
"share_the_love",
|
||||
"stream_desktop_notifications_enabled",
|
||||
"subscriptions",
|
||||
"test_suite",
|
||||
"timezone",
|
||||
|
||||
@@ -222,9 +222,6 @@ def home_real(request):
|
||||
avatar_url_medium = avatar_url(user_profile, medium=True),
|
||||
avatar_source = user_profile.avatar_source,
|
||||
|
||||
# Stream message notification settings:
|
||||
stream_desktop_notifications_enabled = user_profile.enable_stream_desktop_notifications,
|
||||
|
||||
# Private message and @-mention notification settings:
|
||||
desktop_notifications_enabled = desktop_notifications_enabled,
|
||||
pm_content_in_desktop_notifications = user_profile.pm_content_in_desktop_notifications,
|
||||
@@ -264,6 +261,7 @@ def home_real(request):
|
||||
'enable_offline_push_notifications',
|
||||
'enable_online_push_notifications',
|
||||
'enable_sounds',
|
||||
'enable_stream_desktop_notifications',
|
||||
'enable_stream_sounds',
|
||||
'hotspots',
|
||||
'last_event_id',
|
||||
|
||||
Reference in New Issue
Block a user