mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
fix(types): address CodeRabbit review comments
groupNodeManage.ts: - Add bounds checking before accessing node indices in link/external loops - Fix selectedNodeInnerIndex getter with proper runtime guards - Change storeModification section param to string | symbol, removing casts asyncDialog.ts: - Initialize #resolve with no-op function for defensive safety api.ts: - Add warning log for unexpected non-array queue prompts
This commit is contained in:
@@ -925,7 +925,10 @@ export class ComfyApi extends EventTarget {
|
||||
type RawQueuePrompt = V1RawPrompt | CloudRawPrompt
|
||||
|
||||
const normalizeQueuePrompt = (prompt: RawQueuePrompt): TaskPrompt => {
|
||||
if (!Array.isArray(prompt)) return prompt as TaskPrompt
|
||||
if (!Array.isArray(prompt)) {
|
||||
console.warn('Unexpected non-array queue prompt:', prompt)
|
||||
return prompt as TaskPrompt
|
||||
}
|
||||
const fourth = prompt[3]
|
||||
// Cloud shape: 4th is array (outputs), 5th is metadata object
|
||||
if (Array.isArray(fourth)) {
|
||||
|
||||
@@ -6,7 +6,7 @@ type DialogAction<T> = string | { value?: T; text: string }
|
||||
export class ComfyAsyncDialog<
|
||||
T = string | null
|
||||
> extends ComfyDialog<HTMLDialogElement> {
|
||||
#resolve!: (value: T | null) => void
|
||||
#resolve: (value: T | null) => void = () => {}
|
||||
|
||||
constructor(actions?: Array<DialogAction<T>>) {
|
||||
super(
|
||||
|
||||
Reference in New Issue
Block a user