Skip to content

Commit

Permalink
NotificationSettings: Improve omit logic in header.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
spen committed Dec 13, 2018
1 parent 95c6bbf commit 1bfdf87
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions client/me/notification-settings/blogs-settings/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,14 @@ class BlogSettingsHeader extends PureComponent {

getLegend = () => {
const { settings } = this.props;

// Ignore blog_id, email.achievement and devices (we'll handle devices separately).
const filteredSettings = {
...omit( settings, [ 'blog_id', 'devices' ] ),
email: omit( get( settings, 'email', {} ), [
'achievement',
'store_order',
'scheduled_publicize',
] ),
timeline: omit( get( settings, 'timeline', {} ), 'store_order' ),
};
const filteredSettings = omit( settings, [
'blog_id',
'devices',
'email.achievement',
'email.store_order',
'email.scheduled_publicize',
'timeline.store_order',
] );
// Ignore the device_id of each device found.
const devicesSettings = map( settings.devices, device => omit( device, 'device_id' ) );
const { true: onCount, false: offCount } = countBy(
Expand Down

0 comments on commit 1bfdf87

Please sign in to comment.