Skip to content

Commit

Permalink
Stats: Fix tooltip flash on new sites (#95466)
Browse files Browse the repository at this point in the history
  • Loading branch information
a8ck3n authored Oct 18, 2024
1 parent 17e070f commit b887843
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/blocks/stats-navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class StatsNavigation extends Component {
adminUrl: PropTypes.string,
showLock: PropTypes.bool,
hideModuleSettings: PropTypes.bool,
isNewSite: PropTypes.bool,
};

state = {
Expand Down Expand Up @@ -167,6 +168,11 @@ class StatsNavigation extends Component {

// @TODO: Add loading status of modules settings to avoid toggling modules before they are loaded.

// The isNewSite value can be null so we need to guard against that.
// This is semantically incorrect as we expect a boolean value.
// TODO: Update logic in connect() function to send only true/false value.
const delayTooltipPresentation = isNewSite === null || isNewSite;

return (
<div className={ wrapperClass }>
<SectionNav selectedText={ label }>
Expand Down Expand Up @@ -224,7 +230,9 @@ class StatsNavigation extends Component {
pageModules={ pageModules }
onToggleModule={ this.onToggleModule }
isTooltipShown={
showSettingsTooltip && ! isPageSettingsTooltipDismissed && ! isNewSite
showSettingsTooltip &&
! isPageSettingsTooltipDismissed &&
! delayTooltipPresentation
}
onTooltipDismiss={ this.onTooltipDismiss }
/>
Expand Down

0 comments on commit b887843

Please sign in to comment.