File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
src/routes/settings/routes/notifications/components Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -190,21 +190,26 @@ class NotificationSettingsForm extends React.Component {
190190 // we toggle settings for all the types in one topic all together
191191 // so we can use values from the first type to get current value for the whole topic
192192 const topicFirstType = topic . types [ 0 ]
193- const emailStatus = topic . enabledMethods . indexOf ( 'email' ) < 0 ? 'disabled' : null
194- const emailTooltip = topic . enabledMethods . indexOf ( 'email' ) < 0 ? 'Emails are not yet supported for this event type' : ''
193+ const emailStatus = topic . enabledMethods . indexOf ( 'email' ) < 0 ? 'disabled' : null
194+ const emailTooltip = topic . enabledMethods . indexOf ( 'email' ) < 0 ? 'Emails are not yet supported for this event type' : null
195195 return (
196196 < tr key = { index } >
197197 < th > { topic . title } </ th >
198198 < td > < SwitchButton onChange = { ( ) => this . handleChange ( index , 'web' ) } defaultChecked = { notifications [ topicFirstType ] . web . enabled === 'yes' } /> </ td >
199199 < td >
200- < Tooltip theme = "light" tooltipDelay = { TOOLTIP_DEFAULT_DELAY } >
201- < div className = "tooltip-target" >
202- < SwitchButton onChange = { ( ) => this . handleChange ( index , 'email' ) } defaultChecked = { notifications [ topicFirstType ] . email . enabled === 'yes' && emailStatus === null } disabled = { emailStatus } />
203- </ div >
204- < div className = "tooltip-body" >
205- { emailTooltip }
206- </ div >
207- </ Tooltip >
200+ { ! ! emailTooltip &&
201+ < Tooltip theme = "light" tooltipDelay = { TOOLTIP_DEFAULT_DELAY } >
202+ < div className = "tooltip-target" >
203+ < SwitchButton onChange = { ( ) => this . handleChange ( index , 'email' ) } defaultChecked = { notifications [ topicFirstType ] . email . enabled === 'yes' && emailStatus === null } disabled = { emailStatus } />
204+ </ div >
205+ < div className = "tooltip-body" >
206+ { emailTooltip }
207+ </ div >
208+ </ Tooltip >
209+ }
210+ {
211+ ! emailTooltip && < SwitchButton onChange = { ( ) => this . handleChange ( index , 'email' ) } defaultChecked = { notifications [ topicFirstType ] . email . enabled === 'yes' && emailStatus === null } disabled = { emailStatus } />
212+ }
208213 </ td >
209214 </ tr >
210215 )
You can’t perform that action at this time.
0 commit comments