Skip to content

Commit 8e0adad

Browse files
committed
#2654 - fix: avoid reverting to previous values of the notifications settings form after saving
1 parent 8d10f53 commit 8e0adad

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/routes/settings/routes/notifications/components/NotificationSettingsForm.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const initSettings = (notInitedSettings) => {
140140
}
141141

142142
if (_.isUndefined(notifications[type][serviceId].bundlePeriod)) {
143-
// for messageing related email notifications, by default bundle period is set to 'immediately'
143+
// for messaging related email notifications, by default bundle period is set to 'immediately'
144144
if (serviceId === 'email' && _.includes(messagingTypes, type)) {
145145
notifications[type][serviceId].bundlePeriod = 'immediately'
146146

@@ -177,10 +177,9 @@ class NotificationSettingsForm extends React.Component {
177177

178178
componentWillReceiveProps(newProps) {
179179
// after setting were updated on the server
180-
// reinit form with udpdated values
180+
// reinit form with updated values
181181
if (this.props.values.pending && !newProps.values.pending) {
182-
const initialSettings = initSettings(this.props.values.settings)
183-
182+
const initialSettings = initSettings(newProps.values.settings)
184183
this.setState({
185184
initialSettings,
186185
settings: initialSettings,

0 commit comments

Comments
 (0)