Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

telemetry.ts: send telemetry only if aiKey is not empty #3091

Merged
merged 1 commit into from
Mar 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ function sendTelemetryEvent(
properties?: { [key: string]: string },
measures?: { [key: string]: number }
): void {
if (!aiKey) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aiKey is initialized in line 12 and is a constant.
Therefore, in its current state, the extension will not reach a state where this will be empty..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return; // cannot enable telemetry
}
telemtryReporter = telemtryReporter
? telemtryReporter
: new TelemetryReporter(extensionId, extensionVersion, aiKey);
Expand Down