From 35d62e70cbb2ea36891bdd37148d1e063b8f7e30 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Tue, 21 Jan 2020 06:40:31 -0800 Subject: [PATCH] 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 --- src/chrome/DoctorBar.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/chrome/DoctorBar.tsx b/src/chrome/DoctorBar.tsx index 2dc22b189..3bbe3a8fd 100644 --- a/src/chrome/DoctorBar.tsx +++ b/src/chrome/DoctorBar.tsx @@ -55,12 +55,15 @@ class DoctorBar extends Component { 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() {