From 9bd00859d31da0d43cd9dcbb3c27b72de2ca097a Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 15 Aug 2024 11:29:00 +0100 Subject: [PATCH] Fix the telemetry for the new alt-text flow --- src/display/editor/alt_text.js | 4 ++-- src/display/editor/stamp.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/display/editor/alt_text.js b/src/display/editor/alt_text.js index 3b79f0455a613..b9f771503be69 100644 --- a/src/display/editor/alt_text.js +++ b/src/display/editor/alt_text.js @@ -78,7 +78,7 @@ class AltText { if (this.#useNewAltTextFlow) { this.#editor._reportTelemetry({ action: "pdfjs.image.alt_text.image_status_label_clicked", - label: this.#label, + data: { label: this.#label }, }); } }; @@ -237,7 +237,7 @@ class AltText { const type = label === "review" ? "to-review" : label; this.#editor._reportTelemetry({ action: "pdfjs.image.alt_text.image_status_label_displayed", - label, + data: { label }, }); button.classList.toggle("done", !!this.#altText); AltText._l10nPromise diff --git a/src/display/editor/stamp.js b/src/display/editor/stamp.js index 68c6d5407185b..24b17b0072112 100644 --- a/src/display/editor/stamp.js +++ b/src/display/editor/stamp.js @@ -108,7 +108,7 @@ class StampEditor extends AnnotationEditor { get telemetryFinalData() { return { type: "stamp", - hasAltText: this.hasAltTextData(), + hasAltText: !!this.altTextData?.altText, }; }