mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 09:00:05 +00:00
Add toast message on refresh button click (#492)
This commit is contained in:
@@ -12,7 +12,7 @@ const toast = useToast()
|
||||
const toastStore = useToastStore()
|
||||
|
||||
watch(
|
||||
() => toastStore.messages,
|
||||
() => toastStore.messagesToAdd,
|
||||
(newMessages) => {
|
||||
if (newMessages.length === 0) {
|
||||
return
|
||||
@@ -21,8 +21,33 @@ watch(
|
||||
newMessages.forEach((message) => {
|
||||
toast.add(message)
|
||||
})
|
||||
toastStore.removeAll()
|
||||
toastStore.messagesToAdd = []
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => toastStore.messagesToRemove,
|
||||
(messagesToRemove) => {
|
||||
if (messagesToRemove.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
messagesToRemove.forEach((message) => {
|
||||
toast.remove(message)
|
||||
})
|
||||
toastStore.messagesToRemove = []
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => toastStore.removeAllRequested,
|
||||
(requested) => {
|
||||
if (requested) {
|
||||
toast.removeAllGroups()
|
||||
toastStore.removeAllRequested = false
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user