Skip to content

Commit

Permalink
Stats: Stop disabling module toggles (#97913)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangzj authored Jan 3, 2025
1 parent 1e017fb commit aa5c36c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions client/blocks/stats-navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ class StatsNavigation extends Component {
}
);

// toggle the visibility of video module itself
if ( ! nextProps.hasVideoPress ) {
nextProps.pageModuleToggles.videos = false;
}

if (
prevState.pageModules !== nextProps.pageModuleToggles ||
prevState.availableModuleToggles !== nextProps.availableModuleToggles
Expand Down
5 changes: 3 additions & 2 deletions client/blocks/stats-navigation/page-module-toggler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ export default function PageModuleToggler( {
<FormToggle
className="page-modules-settings-toggle-control"
checked={
toggleItem.disabled === false && pageModules[ toggleItem.key ] !== false
pageModules[ toggleItem.key ] !== null
? pageModules[ toggleItem.key ]
: toggleItem.defaultValue
}
disabled={ toggleItem.disabled }
onChange={ ( event: React.ChangeEvent< HTMLInputElement > ) => {
onToggleModule( toggleItem.key, event.target.checked );
} }
Expand Down

0 comments on commit aa5c36c

Please sign in to comment.