home: Get page_params.enable_stream_sounds from register_ret.

This commit is contained in:
Tim Abbott 2017-04-28 21:56:58 -07:00
parent 30db811167
commit 2a8a101fe2
8 changed files with 9 additions and 9 deletions

View File

@ -50,7 +50,7 @@ i18n.init({
left_side_userlist: false,
twenty_four_hour_time: false,
stream_desktop_notifications_enabled: false,
stream_sounds_enabled: false,
enable_stream_sounds: false,
desktop_notifications_enabled: false,
enable_sounds: false,
enable_offline_email_notifications: false,

View File

@ -780,7 +780,7 @@ function render(template_name, args) {
(function settings_tab() {
var page_param_checkbox_options = {
stream_desktop_notifications_enabled: true,
stream_sounds_enabled: true, desktop_notifications_enabled: 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,
enable_digest_emails: true,

View File

@ -638,7 +638,7 @@ exports.handle_global_notification_updates = function (notification_name, settin
if (notification_name === "enable_stream_desktop_notifications") {
page_params.stream_desktop_notifications_enabled = setting;
} else if (notification_name === "enable_stream_sounds") {
page_params.stream_sounds_enabled = setting;
page_params.enable_stream_sounds = setting;
} else if (notification_name === "enable_desktop_notifications") {
page_params.desktop_notifications_enabled = setting;
} else if (notification_name === "enable_sounds") {

View File

@ -20,7 +20,7 @@ exports.set_up = function () {
result.enable_stream_desktop_notifications;
}
if (result.enable_stream_sounds !== undefined) {
page_params.stream_sounds_enabled = result.enable_stream_sounds;
page_params.enable_stream_sounds = result.enable_stream_sounds;
}
// PM and @-mention notification settings.
@ -143,7 +143,7 @@ exports.set_up = function () {
function _update_page() {
$("#enable_stream_desktop_notifications").prop('checked', page_params.stream_desktop_notifications_enabled);
$("#enable_stream_sounds").prop('checked', page_params.stream_sounds_enabled);
$("#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);
$("#enable_offline_email_notifications").prop('checked', page_params.enable_offline_email_notifications);

View File

@ -279,7 +279,7 @@ exports.create_sub_from_server_data = function (stream_name, attrs) {
in_home_view: true,
invite_only: false,
desktop_notifications: page_params.stream_desktop_notifications_enabled,
audible_notifications: page_params.stream_sounds_enabled,
audible_notifications: page_params.enable_stream_sounds,
description: '',
});

View File

@ -31,7 +31,7 @@
<div class="input-group">
<label class="checkbox">
<input type="checkbox" class="inline-block" name="enable_stream_sounds" id="enable_stream_sounds"
{{#if page_params.stream_sounds_enabled}}
{{#if page_params.enable_stream_sounds}}
checked="checked"
{{/if}} />
<span></span>

View File

@ -63,6 +63,7 @@ class HomeTest(ZulipTestCase):
"enable_offline_push_notifications",
"enable_online_push_notifications",
"enable_sounds",
"enable_stream_sounds",
"enter_sends",
"first_in_realm",
"fullname",
@ -133,7 +134,6 @@ class HomeTest(ZulipTestCase):
"server_uri",
"share_the_love",
"stream_desktop_notifications_enabled",
"stream_sounds_enabled",
"subscriptions",
"test_suite",
"timezone",

View File

@ -224,7 +224,6 @@ def home_real(request):
# Stream message notification settings:
stream_desktop_notifications_enabled = user_profile.enable_stream_desktop_notifications,
stream_sounds_enabled = user_profile.enable_stream_sounds,
# Private message and @-mention notification settings:
desktop_notifications_enabled = desktop_notifications_enabled,
@ -265,6 +264,7 @@ def home_real(request):
'enable_offline_push_notifications',
'enable_online_push_notifications',
'enable_sounds',
'enable_stream_sounds',
'hotspots',
'last_event_id',
'left_side_userlist',