1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-20 16:22:28 +03:00

Merge pull request #2678 from matrix-org/travis/fix-email-config

Fix toggle for email notifications
This commit is contained in:
Travis Ralston
2019-02-22 08:22:43 -07:00
committed by GitHub

View File

@@ -28,7 +28,7 @@ import {
PushRuleVectorState, PushRuleVectorState,
ContentRules, ContentRules,
} from '../../../notifications'; } from '../../../notifications';
import * as SdkConfig from "../../../SdkConfig"; import SdkConfig from "../../../SdkConfig";
import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch";
// TODO: this "view" component still has far too much application logic in it, // TODO: this "view" component still has far too much application logic in it,
@@ -132,9 +132,9 @@ module.exports = React.createClass({
}); });
}, },
onEnableEmailNotificationsChange: function(address, event) { onEnableEmailNotificationsChange: function(address, checked) {
let emailPusherPromise; let emailPusherPromise;
if (event.target.checked) { if (checked) {
const data = {}; const data = {};
data['brand'] = SdkConfig.get().brand || 'Riot'; data['brand'] = SdkConfig.get().brand || 'Riot';
emailPusherPromise = UserSettingsStore.addEmailPusher(address, data); emailPusherPromise = UserSettingsStore.addEmailPusher(address, data);