From 946823ce6c2e979df8b57a356f497d73c577f4c0 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Mon, 18 Nov 2024 20:25:18 -0500 Subject: [PATCH] [Electron] Add Comfy-Desktop.SendStatistics setting (#1594) --- src/extensions/core/electronAdapter.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/extensions/core/electronAdapter.ts b/src/extensions/core/electronAdapter.ts index 50c58d3d2..79454a080 100644 --- a/src/extensions/core/electronAdapter.ts +++ b/src/extensions/core/electronAdapter.ts @@ -22,6 +22,21 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil' ) } } + }, + { + id: 'Comfy-Desktop.SendStatistics', + category: ['Comfy-Desktop', 'General', 'Send Statistics'], + name: 'Send anonymous usage statistics', + type: 'boolean', + defaultValue: true, + onChange(newValue, oldValue) { + if (oldValue !== undefined && newValue !== oldValue) { + electronAPI.restartApp( + 'Restart ComfyUI to apply changes.', + 1500 // add delay to allow changes to take effect before restarting. + ) + } + } } ],