mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 17:40:09 +00:00
[Desktop] Report completed generation status (#2279)
This commit is contained in:
@@ -77,6 +77,29 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
if (isElectron()) {
|
||||
watch(
|
||||
() => queueStore.tasks,
|
||||
(newTasks, oldTasks) => {
|
||||
// Report tasks that previously running but are now completed (i.e. in history)
|
||||
const oldRunningTaskIds = new Set(
|
||||
oldTasks.filter((task) => task.isRunning).map((task) => task.promptId)
|
||||
)
|
||||
newTasks
|
||||
.filter(
|
||||
(task) => oldRunningTaskIds.has(task.promptId) && task.isHistory
|
||||
)
|
||||
.forEach((task) => {
|
||||
electronAPI().Events.incrementUserProperty(
|
||||
`execution:${task.displayStatus.toLowerCase()}`,
|
||||
1
|
||||
)
|
||||
})
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
const fontSize = settingStore.get('Comfy.TextareaWidget.FontSize')
|
||||
document.documentElement.style.setProperty(
|
||||
|
||||
@@ -63,6 +63,9 @@ const mockElectronAPI: Plugin = {
|
||||
Events: {
|
||||
trackEvent: (event_name, event_data) => {
|
||||
console.log('trackEvent', event_name, event_data)
|
||||
},
|
||||
incrementUserProperty: (property, value) => {
|
||||
console.log('incrementUserProperty', property, value)
|
||||
}
|
||||
}
|
||||
};`
|
||||
|
||||
Reference in New Issue
Block a user