Expose "enable telemetry"

This commit is contained in:
Andras Schmelczer 2025-11-18 22:06:59 +00:00
parent 377abe1362
commit 402a37c6a6
3 changed files with 29 additions and 6 deletions

View file

@ -20,6 +20,7 @@
"fs-extra": "^11.3.0",
"mini-css-extract-plugin": "^2.9.2",
"obsidian": "1.10.2",
"reconcile-text": "^0.7.1",
"resolve-url-loader": "^5.0.0",
"sass": "^1.91.0",
"sass-loader": "^16.0.5",

View file

@ -72,6 +72,7 @@ export class SyncSettingsTab extends PluginSettingTab {
this.renderSettingsHeader(containerEl);
this.renderConnectionSettings(containerEl);
this.renderSyncSettings(containerEl);
this.renderMiscSettings(containerEl);
}
public hide(): void {
@ -339,6 +340,26 @@ export class SyncSettingsTab extends PluginSettingTab {
);
}
private renderMiscSettings(containerEl: HTMLElement): void {
containerEl.createEl("h3", { text: "Other" });
new Setting(containerEl)
.setName("Enable telemetry")
.setDesc(
"Allow sending anonymous usage data & error reports to help improve the plugin. The data collected is never shared with third parties."
)
.setTooltip(
"Allow sending anonymous usage data & error reports to help improve the plugin. The data collected is never shared with third parties."
)
.addToggle((toggle) =>
toggle
.setValue(this.syncClient.getSettings().enableTelemetry)
.onChange(async (value) =>
this.syncClient.setSetting("enableTelemetry", value)
)
);
}
private setStatusDescriptionSubscription(
newSubscription?: () => unknown
): void {

View file

@ -3487,6 +3487,12 @@
"node": ">= 10.13.0"
}
},
"node_modules/reconcile-text": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/reconcile-text/-/reconcile-text-0.7.1.tgz",
"integrity": "sha512-khedcYvAKs7ELKh5Z8mz2vyomMY5TqznV1dB+k/7qUAX9cheMNN5/EPJVQYZepOMunYbnQitvhFJX3kD4IMcNw==",
"license": "MIT"
},
"node_modules/regex-parser": {
"version": "2.3.1",
"dev": true,
@ -4648,6 +4654,7 @@
"fs-extra": "^11.3.0",
"mini-css-extract-plugin": "^2.9.2",
"obsidian": "1.10.2",
"reconcile-text": "^0.7.1",
"resolve-url-loader": "^5.0.0",
"sass": "^1.91.0",
"sass-loader": "^16.0.5",
@ -4707,12 +4714,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"sync-client/node_modules/reconcile-text": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/reconcile-text/-/reconcile-text-0.7.1.tgz",
"integrity": "sha512-khedcYvAKs7ELKh5Z8mz2vyomMY5TqznV1dB+k/7qUAX9cheMNN5/EPJVQYZepOMunYbnQitvhFJX3kD4IMcNw==",
"license": "MIT"
},
"test-client": {
"version": "0.10.0",
"bin": {