Skip to content

Commit 8274df5

Browse files
authored
Fixed favicon some progress frames not found - by ComfyWaifu 🤍 (#4143)
1 parent 55bf365 commit 8274df5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/composables/useProgressFavicon.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export const useProgressFavicon = () => {
1515
if (isIdle) {
1616
favicon.value = defaultFavicon
1717
} else {
18-
const frame = Math.floor(progress * totalFrames)
18+
const frame = Math.min(
19+
Math.max(0, Math.floor(progress * totalFrames)),
20+
totalFrames - 1
21+
)
1922
favicon.value = `/assets/images/favicon_progress_16x16/frame_${frame}.png`
2023
}
2124
}

src/stores/executionStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const useExecutionStore = defineStore('execution', () => {
8888
if (!activePrompt.value) return 0
8989
const total = totalNodesToExecute.value
9090
const done = nodesExecuted.value
91-
return done / total
91+
return total > 0 ? done / total : 0
9292
})
9393

9494
function bindExecutionEvents() {

0 commit comments

Comments
 (0)