mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
Fix gallery changing image every time a task finishes (#2125)
This commit is contained in:
@@ -242,4 +242,21 @@ export class QueueSidebarTab extends SidebarTab {
|
||||
localStorage.setItem('queue', JSON.stringify([width, 100 - width]))
|
||||
}, width)
|
||||
}
|
||||
|
||||
getTaskPreviewButton(taskIndex: number) {
|
||||
return this.tasks.nth(taskIndex).getByRole('button')
|
||||
}
|
||||
|
||||
async openTaskPreview(taskIndex: number) {
|
||||
const previewButton = this.getTaskPreviewButton(taskIndex)
|
||||
await previewButton.hover()
|
||||
await previewButton.click()
|
||||
return this.getGalleryImage(taskIndex).waitFor({ state: 'visible' })
|
||||
}
|
||||
|
||||
getGalleryImage(galleryItemIndex: number) {
|
||||
// Aria labels of Galleria items are 1-based indices
|
||||
const galleryLabel = `${galleryItemIndex + 1}`
|
||||
return this.page.getByLabel(galleryLabel).locator('.galleria-image')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user