Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow telemetry by default #62

Merged
merged 2 commits into from
Apr 19, 2023
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
12 changes: 5 additions & 7 deletions skyline-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function activate(context: vscode.ExtensionContext) {
canSelectFiles: false,
canSelectFolders: true,
canSelectMany: false,
title: "Skyline"
title: "DeepView"
};

vscode.window.showOpenDialog(options).then(uri => {
Expand Down Expand Up @@ -90,22 +90,20 @@ async function showTelemetryOptInDialogIfNeeded() {
let vsconfig = vscode.workspace.getConfiguration('deepview');
if (vsconfig.isTelemetryEnabled === "Ask me"){
// Pop up the message then wait
const message: string = `Help CentML improve DeepView by allowing us to collect usage data.
Read our [privacy statement](${PRIVACY_STATEMENT_URL})
and learn how to [opt out](${OPT_OUT_INSTRUCTIONS_URL}).`;
const message: string = `DeepView collects usage data to help improve the tool. Read CentML's [privacy statement](${PRIVACY_STATEMENT_URL})
and learn how to [opt out](${OPT_OUT_INSTRUCTIONS_URL}). Note that DeepView respects VSCode's telemetry settings and this takes precedence over DeepView's settings`;

const retryOptin = setTimeout(showTelemetryOptInDialogIfNeeded, RETRY_OPTIN_DELAY_IN_MS);
let selection: string | undefined;
selection = await vscode.window.showInformationMessage(message, 'Yes', 'No');
selection = await vscode.window.showInformationMessage(message, 'OK');
if (!selection) {
return;
}
clearTimeout(retryOptin);
vsconfig.update("isTelemetryEnabled", selection, true);
}
}

function isTelemetryEnabled(): boolean {
let vsconfig = vscode.workspace.getConfiguration('deepview');
return (vsconfig.isTelemetryEnabled === "Yes");
return (vsconfig.isTelemetryEnabled !== "No");
}