mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-24 16:29:45 +00:00
Add toast message on execution interrupted (#490)
* Move toast to top level * Toast store
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
import { app } from '../../scripts/app'
|
||||
import { api } from '../../scripts/api'
|
||||
import { useToastStore } from '@/stores/toastStore'
|
||||
|
||||
app.registerExtension({
|
||||
name: 'Comfy.Keybinds',
|
||||
init() {
|
||||
const keybindListener = function (event) {
|
||||
const keybindListener = async function (event) {
|
||||
const modifierPressed = event.ctrlKey || event.metaKey
|
||||
|
||||
// Queue prompt using (ctrl or command) + enter
|
||||
if (modifierPressed && event.key === 'Enter') {
|
||||
// Cancel current prompt using (ctrl or command) + alt + enter
|
||||
if (event.altKey) {
|
||||
api.interrupt()
|
||||
await api.interrupt()
|
||||
useToastStore().add({
|
||||
severity: 'info',
|
||||
summary: 'Interrupted',
|
||||
detail: 'Execution has been interrupted',
|
||||
life: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
// Queue prompt as first for generation using (ctrl or command) + shift + enter
|
||||
|
||||
Reference in New Issue
Block a user