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

@@ -764,5 +764,12 @@ export const CORE_SETTINGS: SettingParams[] = [
max: 400
},
versionAdded: '1.15.7'
},
{
id: 'Comfy.Toast.DisableReconnectingToast',
name: 'Disable toasts when reconnecting or reconnected',
type: 'hidden',
defaultValue: false,
versionAdded: '1.15.12'
}
]

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(() => {