Analytics: log both shown and suppressed warnings

Summary: A small enhancement for the Doctor usage report

Reviewed By: passy

Differential Revision: D19496887

fbshipit-source-id: 1f0efb0eb29e2efce60ba4fca3bd6fdc062406ea
This commit is contained in:
Anton Nikolaev
2020-01-21 06:40:31 -08:00
committed by Facebook Github Bot
parent 94e2230583
commit 35d62e70cb

View File

@@ -55,12 +55,15 @@ class DoctorBar extends Component<Props, State> {
async showMessageIfChecksFailed() {
await runHealthchecks(this.props);
if (
(this.props.healthcheckResult.status === 'FAILED' ||
this.props.healthcheckResult.status === 'WARNING') &&
!this.props.healthcheckResult.isAcknowledged
this.props.healthcheckResult.status === 'FAILED' ||
this.props.healthcheckResult.status === 'WARNING'
) {
this.setVisible(true);
reportUsage('doctor:warning:shown');
if (this.props.healthcheckResult.isAcknowledged) {
reportUsage('doctor:warning:suppressed');
} else {
this.setVisible(true);
reportUsage('doctor:warning:shown');
}
}
}
render() {