settings: Don't check mobile notifications if they are disabled.

Fixes #12198.
This commit is contained in:
Shubham Padia 2019-04-30 11:56:23 +08:00 committed by Tim Abbott
parent ed81906fc9
commit 27ff71c96f
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ exports.set_up = function () {
exports.update_page = function () {
_.each(exports.notification_settings, function (setting) {
if (setting === 'enable_offline_push_notifications'
&& !page_params.realm_push_notifications_enabled) {
// If push notifications are disabled at the realm level,
// we should just leave the checkbox always off.
return;
}
$("#" + setting).prop('checked', page_params[setting]);
});
};