mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
- Fix per-node callback restoration on cleanup in useErrorClearingHooks - Add unmount cancellation guard to useErrorReport async onMounted - Move missingNodesErrorStore to platform/nodeReplacement (DDD alignment) - Extract activeMissingNodeGraphIds to component-level computed - Extract useErrorActions composable (deduplicate telemetry+command pattern) - Add data-testid to copy button, use in test selector - Add tests for onNodeRemoved restoration and double-install guard - Return watch stop handle from useNodeErrorFlagSync - Add asyncResolvedIds eviction on missingNodesError reset - Add console.warn to silent catch blocks and empty array guard - Hoist useCommandStore to setup scope, fix floating promises - Replace replace() with replaceAll() in testid expression - Convert function expression to declaration in FindIssueButton
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { useCommandStore } from '@/stores/commandStore'
|
|
import { useExternalLink } from '@/composables/useExternalLink'
|
|
import { useTelemetry } from '@/platform/telemetry'
|
|
|
|
export function useErrorActions() {
|
|
const telemetry = useTelemetry()
|
|
const commandStore = useCommandStore()
|
|
const { staticUrls } = useExternalLink()
|
|
|
|
function openGitHubIssues() {
|
|
telemetry?.trackUiButtonClicked({
|
|
button_id: 'error_tab_github_issues_clicked'
|
|
})
|
|
window.open(staticUrls.githubIssues, '_blank', 'noopener,noreferrer')
|
|
}
|
|
|
|
function contactSupport() {
|
|
telemetry?.trackHelpResourceClicked({
|
|
resource_type: 'help_feedback',
|
|
is_external: true,
|
|
source: 'error_dialog'
|
|
})
|
|
void commandStore.execute('Comfy.ContactSupport')
|
|
}
|
|
|
|
function findOnGitHub(errorMessage: string) {
|
|
telemetry?.trackUiButtonClicked({
|
|
button_id: 'error_tab_find_existing_issues_clicked'
|
|
})
|
|
const query = encodeURIComponent(errorMessage + ' is:issue')
|
|
window.open(
|
|
`${staticUrls.githubIssues}?q=${query}`,
|
|
'_blank',
|
|
'noopener,noreferrer'
|
|
)
|
|
}
|
|
|
|
return { openGitHubIssues, contactSupport, findOnGitHub }
|
|
}
|