Comfy-Org / Comfy-Org/ComfyUI_frontend
fix: guard isReady against getShareableAssets() failure in ComfyHubFinishStep
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
In `src/platform/workflow/sharing/components/publish/ComfyHubFinishStep.vue`, if `getShareableAssets()` rejects or fails, `privateAssets` stays at its default value of `[]` (empty array). Because `isReady` only checks `!isLoadingAssets.value && (!hasPrivateAssets.value || acknowledged.value)`, a failed fetch can incorrectly evaluate `isReady` as `true`, allowing the user to progress through the publish wizard without completing the private-asset acknowledgment step.
## Proposed Fix
Destructure the `error` ref from `useAsyncState` and include it in the `isReady` guard:
```ts
const {
state: privateAssets,
isLoading: isLoadingAssets,
error: privateAssetsError
} = useAsyncState(
() => shareService.getShareableAssets(),
[]
)
const isReady = computed(
() =>
!isLoadingAssets.value &&
!privateAssetsError.value &&
(!hasPrivateAssets.value || acknowledged.value)
)
```
Optionally, also render an error state in the template so the user knows the check failed.
## Context
- Identified during review of PR #10128 (ComfyHub publish wizard wiring)
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10128#discussion_r2943841278
- Requested as follow-up by @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10463-fix-guard-isReady-against-getShareableAssets-failure-in-ComfyHubFinishStep-32d6d73d36508139b31afdb29c23d5ec) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.