mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
refactor: remove redundant animated filtering from TaskItemImpl
animated is already excluded by METADATA_KEYS in parseNodeOutput, so the _.omit call in the constructor was redundant. Also removes unused es-toolkit/compat import. Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9622#discussion_r2925170222
This commit is contained in:
@@ -66,7 +66,7 @@ vi.mock('@/scripts/api', () => ({
|
||||
}))
|
||||
|
||||
describe('TaskItemImpl', () => {
|
||||
it('should remove animated property from outputs during construction', () => {
|
||||
it('should exclude animated from flatOutputs', () => {
|
||||
const job = createHistoryJob(0, 'job-id')
|
||||
const taskItem = new TaskItemImpl(job, {
|
||||
'node-1': {
|
||||
@@ -75,11 +75,9 @@ describe('TaskItemImpl', () => {
|
||||
}
|
||||
})
|
||||
|
||||
// Check that animated property was removed
|
||||
expect('animated' in taskItem.outputs['node-1']).toBe(false)
|
||||
|
||||
expect(taskItem.outputs['node-1'].images).toBeDefined()
|
||||
expect(taskItem.outputs['node-1'].images?.[0]?.filename).toBe('test.png')
|
||||
expect(taskItem.flatOutputs).toHaveLength(1)
|
||||
expect(taskItem.flatOutputs[0].filename).toBe('test.png')
|
||||
expect(taskItem.flatOutputs[0].mediaType).toBe('images')
|
||||
})
|
||||
|
||||
it('should handle outputs without animated property', () => {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import _ from 'es-toolkit/compat'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, ref, shallowRef, toRaw, toValue } from 'vue'
|
||||
|
||||
@@ -257,10 +256,7 @@ export class TaskItemImpl {
|
||||
}
|
||||
}
|
||||
: {})
|
||||
// Remove animated outputs from the outputs object
|
||||
this.outputs = _.mapValues(effectiveOutputs, (nodeOutputs) =>
|
||||
_.omit(nodeOutputs, 'animated')
|
||||
)
|
||||
this.outputs = effectiveOutputs
|
||||
this.flatOutputs = flatOutputs ?? this.calculateFlatOutputs()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user