Skip to content

Commit 8b38c41

Browse files
committed
always cancel raf
1 parent c797e1b commit 8b38c41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/renderer/extensions/linearMode/linearOutputStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ export const useLinearOutputStore = defineStore('linearOutput', () => {
5656

5757
let raf: number | null = null
5858
function onLatentPreview(jobId: string, url: string, nodeId?: string) {
59+
if (raf) cancelAnimationFrame(raf)
5960
if (nodeId && executedNodeIds.has(nodeId)) return
6061

6162
// Issue in Firefox where it doesnt seem to always re-render, wrapping in RAF fixes it
62-
if (raf) cancelAnimationFrame(raf)
6363
raf = requestAnimationFrame(() => {
6464
const existing = inProgressItems.value.find(
6565
(i) => i.id === currentSkeletonId.value && i.jobId === jobId

0 commit comments

Comments
 (0)