mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
## Summary
Remove `life` (timeout) property from all error-severity toast calls so
they persist until manually dismissed, preventing users from missing
important error messages.
## Changes
- **What**: Removed `life` property from 86 error toast calls across 46
files. Error toasts now use PrimeVue's default behavior (no
auto-dismiss). Non-error toasts (success, warn, info) are unchanged.
- Also fixed a pre-existing lint issue in `TaskListPanel.vue` (`import {
t } from '@/i18n'` → `useI18n()`)
## Review Focus
- One conditional toast in `useMediaAssetActions.ts` intentionally keeps
`life` because its severity alternates between `warn` and `error`
Fixes
https://www.notion.so/comfy-org/Implement-Remove-timeouts-for-all-error-toasts-31b6d73d365081cead54fddc77ae7c3d
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9543-fix-remove-timeouts-from-error-toasts-so-they-persist-until-dismissed-31c6d73d365081fa8d30f6366e9bfe38)
by [Unito](https://www.unito.io)
83 lines
2.3 KiB
Vue
83 lines
2.3 KiB
Vue
<template>
|
|
<BaseViewTemplate dark hide-language-selector>
|
|
<div class="flex h-full flex-col items-center justify-center p-8 2xl:p-16">
|
|
<div
|
|
class="flex w-full max-w-[600px] flex-col gap-6 rounded-lg bg-neutral-800 p-6 shadow-lg"
|
|
>
|
|
<h2 class="text-3xl font-semibold text-neutral-100">
|
|
{{ $t('install.helpImprove') }}
|
|
</h2>
|
|
<p class="text-neutral-400">
|
|
{{ $t('install.updateConsent') }}
|
|
</p>
|
|
<p class="text-neutral-400">
|
|
{{ $t('install.moreInfo') }}
|
|
<a
|
|
href="https://comfy.org/privacy"
|
|
target="_blank"
|
|
class="text-blue-400 underline hover:text-blue-300"
|
|
>
|
|
{{ $t('install.privacyPolicy') }} </a
|
|
>.
|
|
</p>
|
|
<div class="flex items-center gap-4">
|
|
<ToggleSwitch
|
|
v-model="allowMetrics"
|
|
aria-describedby="metricsDescription"
|
|
/>
|
|
<span id="metricsDescription" class="text-neutral-100">
|
|
{{
|
|
allowMetrics
|
|
? $t('install.metricsEnabled')
|
|
: $t('install.metricsDisabled')
|
|
}}
|
|
</span>
|
|
</div>
|
|
<div class="flex justify-end pt-6">
|
|
<Button
|
|
:label="$t('g.ok')"
|
|
icon="pi pi-check"
|
|
:loading="isUpdating"
|
|
icon-pos="right"
|
|
@click="updateConsent"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</BaseViewTemplate>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Button from 'primevue/button'
|
|
import ToggleSwitch from 'primevue/toggleswitch'
|
|
import { useToast } from 'primevue/usetoast'
|
|
import { ref } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useRouter } from 'vue-router'
|
|
|
|
import { electronAPI } from '@/utils/envUtil'
|
|
|
|
const toast = useToast()
|
|
const { t } = useI18n()
|
|
|
|
const allowMetrics = ref(true)
|
|
const router = useRouter()
|
|
const isUpdating = ref(false)
|
|
|
|
const updateConsent = async () => {
|
|
isUpdating.value = true
|
|
try {
|
|
await electronAPI().setMetricsConsent(allowMetrics.value)
|
|
} catch (error) {
|
|
toast.add({
|
|
severity: 'error',
|
|
summary: t('install.settings.errorUpdatingConsent'),
|
|
detail: t('install.settings.errorUpdatingConsentDetail')
|
|
})
|
|
} finally {
|
|
isUpdating.value = false
|
|
}
|
|
await router.push('/')
|
|
}
|
|
</script>
|