Ignore the default value when calculating if notifications are enabled

This is to make the "Enable desktop notifications" checkbox accurately reflect the user's preference. The device-level setting is still respected. 

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Travis Ralston
2017-12-25 13:29:30 -07:00
parent 6f674f21f6
commit 2815c576c1
3 changed files with 11 additions and 9 deletions

View File

@@ -35,11 +35,11 @@ function isMasterRuleEnabled() {
}
export class NotificationsEnabledController extends SettingController {
getValueOverride(level, roomId, calculatedValue) {
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
const Notifier = require('../../Notifier'); // avoids cyclical references
if (!Notifier.isPossible()) return false;
if (calculatedValue === null) {
if (calculatedValue === null || calculatedAtLevel === "default") {
return isMasterRuleEnabled();
}