Skip to content

Commit 71fa71e

Browse files
authored
Prefer saved media over preview media as task cover media (#576)
1 parent 77ba201 commit 71fa71e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/stores/queueStore.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
ResultItem
1111
} from '@/types/apiTypes'
1212
import type { NodeId } from '@/types/comfyWorkflow'
13-
import { instanceToPlain, plainToClass } from 'class-transformer'
13+
import { plainToClass } from 'class-transformer'
1414
import _ from 'lodash'
1515
import { defineStore } from 'pinia'
1616
import { toRaw } from 'vue'
@@ -88,7 +88,12 @@ export class TaskItemImpl {
8888
}
8989

9090
get previewOutput(): ResultItemImpl | undefined {
91-
return this.flatOutputs.find((output) => output.supportsPreview)
91+
return (
92+
this.flatOutputs.find(
93+
// Prefer saved media files over the temp previews
94+
(output) => output.type === 'output' && output.supportsPreview
95+
) ?? this.flatOutputs.find((output) => output.supportsPreview)
96+
)
9297
}
9398

9499
get apiTaskType(): APITaskType {

0 commit comments

Comments
 (0)