Add option to disable reconnecting toasts (#3327)

This commit is contained in:
Christian Byrne
2025-04-06 06:50:25 +08:00
committed by GitHub
parent bb094cf0ae
commit 65f1561ec6
2 changed files with 19 additions and 8 deletions

View File

@@ -176,17 +176,21 @@ const reconnectingMessage: ToastMessageOptions = {
}
const onReconnecting = () => {
toast.remove(reconnectingMessage)
toast.add(reconnectingMessage)
if (!settingStore.get('Comfy.Toast.DisableReconnectingToast')) {
toast.remove(reconnectingMessage)
toast.add(reconnectingMessage)
}
}
const onReconnected = () => {
toast.remove(reconnectingMessage)
toast.add({
severity: 'success',
summary: t('g.reconnected'),
life: 2000
})
if (!settingStore.get('Comfy.Toast.DisableReconnectingToast')) {
toast.remove(reconnectingMessage)
toast.add({
severity: 'success',
summary: t('g.reconnected'),
life: 2000
})
}
}
onMounted(() => {