File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/shared/components/Settings/Preferences/Email Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ const programs = [
72
72
73
73
export default class EmailPreferences extends React . Component {
74
74
saveEmailPreferences = debounce ( ( id , checked ) => {
75
+ // update local state
76
+ const { emailPreferences, status } = this . state ;
77
+ emailPreferences [ id ] = checked ;
78
+ this . setState ( {
79
+ emailPreferences,
80
+ status : checked ? 'subscribed' : status ,
81
+ } ) ;
75
82
const { email, saveEmailPreferences } = this . props ;
76
83
saveEmailPreferences ( email , id , checked ) ;
77
84
} , SAVE_DELAY ) ;
@@ -108,13 +115,6 @@ export default class EmailPreferences extends React.Component {
108
115
109
116
onChange ( id , checked ) {
110
117
// document.querySelectorAll(`#pre-onoffswitch-${id}`).forEach((el) => { el.checked = checked; }); // eslint-disable-line no-param-reassign
111
- // update local state
112
- const { emailPreferences, status } = this . state ;
113
- emailPreferences [ id ] = checked ;
114
- this . setState ( {
115
- emailPreferences,
116
- status : checked ? 'subscribed' : status ,
117
- } ) ;
118
118
// update remote state
119
119
this . saveEmailPreferences ( id , checked ) ;
120
120
}
You can’t perform that action at this time.
0 commit comments