mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-11 23:59:51 +00:00
respect telemetry settings
This commit is contained in:
@@ -2,7 +2,7 @@ import * as vscode from 'vscode';
|
|||||||
import * as cp from 'child_process';
|
import * as cp from 'child_process';
|
||||||
import * as util from 'util';
|
import * as util from 'util';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import html from './ui';
|
import getHtml from './ui';
|
||||||
|
|
||||||
const exec = util.promisify(cp.exec);
|
const exec = util.promisify(cp.exec);
|
||||||
|
|
||||||
@@ -2136,7 +2136,7 @@ class ClaudeChatProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _getHtmlForWebview(): string {
|
private _getHtmlForWebview(): string {
|
||||||
return html;
|
return getHtml(vscode.env?.isTelemetryEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _sendCurrentSettings(): void {
|
private _sendCurrentSettings(): void {
|
||||||
|
|||||||
12
src/ui.ts
12
src/ui.ts
@@ -1,5 +1,5 @@
|
|||||||
import styles from './ui-styles'
|
import styles from './ui-styles'
|
||||||
const html = `<!DOCTYPE html>
|
const getHtml = (isTelemetryEnabled: boolean) => `<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
@@ -1470,13 +1470,15 @@ const html = `<!DOCTYPE html>
|
|||||||
|
|
||||||
// Send usage statistics
|
// Send usage statistics
|
||||||
function sendStats(eventName) {
|
function sendStats(eventName) {
|
||||||
try {
|
${isTelemetryEnabled ?
|
||||||
|
`try {
|
||||||
if (typeof umami !== 'undefined' && umami.track) {
|
if (typeof umami !== 'undefined' && umami.track) {
|
||||||
umami.track(eventName);
|
umami.track(eventName);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error sending stats:', error);
|
console.error('Error sending stats:', error);
|
||||||
}
|
}` :
|
||||||
|
`// Telemetry disabled - no tracking`}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateStatus(text, state = 'ready') {
|
function updateStatus(text, state = 'ready') {
|
||||||
@@ -3669,8 +3671,8 @@ const html = `<!DOCTYPE html>
|
|||||||
2. Do I need to display a cookie notice to users?
|
2. Do I need to display a cookie notice to users?
|
||||||
No, Umami does not use any cookies in the tracking code.
|
No, Umami does not use any cookies in the tracking code.
|
||||||
-->
|
-->
|
||||||
<script defer src="https://cloud.umami.is/script.js" data-website-id="d050ac9b-2b6d-4c67-b4c6-766432f95644"></script>
|
${isTelemetryEnabled ? '<script defer src="https://cloud.umami.is/script.js" data-website-id="d050ac9b-2b6d-4c67-b4c6-766432f95644"></script>' : '<!-- Umami analytics disabled due to VS Code telemetry settings -->'}
|
||||||
</body>
|
</body>
|
||||||
</html>`;
|
</html>`;
|
||||||
|
|
||||||
export default html;
|
export default getHtml;
|
||||||
Reference in New Issue
Block a user