From d01261a228fd6cda693623a85832bd567693512e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 31 Jul 2017 11:51:43 -0400 Subject: PLT-7177: Change the default email frequency to 15 minutes if batching is enabled on the server. (#7036) * PLT-7177: Found default preference that needs to be changed * PLT-7177: Front end behaves as desired * PLT-7177: Changed default batching interval on server side * PLT-7177: Added unit tests for new default interval * PLT-7177: Removed unused import * PLT-7177: Renamed constants to increase clarity --- .../user_settings/email_notification_setting.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'webapp/components/user_settings') diff --git a/webapp/components/user_settings/email_notification_setting.jsx b/webapp/components/user_settings/email_notification_setting.jsx index 4dd15f0be..5abdc3384 100644 --- a/webapp/components/user_settings/email_notification_setting.jsx +++ b/webapp/components/user_settings/email_notification_setting.jsx @@ -28,13 +28,20 @@ export default class EmailNotificationSetting extends React.Component { super(props); this.submit = this.submit.bind(this); - this.expand = this.expand.bind(this); this.collapse = this.collapse.bind(this); - this.state = { - emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, Preferences.INTERVAL_IMMEDIATE) - }; + if (global.mm_config.EnableEmailBatching === 'true') { + // when email batching is enabled, the default interval is 15 minutes + this.state = { + emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, Preferences.INTERVAL_FIFTEEN_MINUTES) + }; + } else { + // otherwise, the default interval is immediately + this.state = { + emailInterval: PreferenceStore.getInt(Preferences.CATEGORY_NOTIFICATIONS, Preferences.EMAIL_INTERVAL, Preferences.INTERVAL_IMMEDIATE) + }; + } } handleChange(enableEmail, emailInterval) { -- cgit v1.2.3-1-g7c22