mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
fix: address coderabbit round 3 — reactivity, a11y, user feedback
- Use getter function with until() for Pinia store reactivity (useErrorReport) - Set alt="" on decorative thumbnail images (MissingMediaLibrarySelect) - Show toast on unsupported file type instead of silent return
This commit is contained in:
@@ -48,7 +48,7 @@ export function useErrorReport(cardSource: MaybeRefOrGetter<ErrorCardData>) {
|
||||
|
||||
if (!systemStatsStore.systemStats) {
|
||||
if (systemStatsStore.isLoading) {
|
||||
await until(systemStatsStore.isLoading).toBe(false)
|
||||
await until(() => systemStatsStore.isLoading).toBe(false)
|
||||
} else {
|
||||
try {
|
||||
await systemStatsStore.refetchSystemStats()
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<img
|
||||
v-if="mediaType === 'image'"
|
||||
:src="getPreviewUrl(option.value)"
|
||||
:alt="option.name"
|
||||
alt=""
|
||||
class="size-8 shrink-0 rounded-sm object-cover"
|
||||
loading="lazy"
|
||||
/>
|
||||
|
||||
@@ -138,7 +138,15 @@ export function useMissingMediaInteractions() {
|
||||
: mediaType === 'video'
|
||||
? 'video/'
|
||||
: 'image/'
|
||||
if (!file.type || !file.type.startsWith(expectedPrefix)) return
|
||||
if (!file.type || !file.type.startsWith(expectedPrefix)) {
|
||||
useToastStore().addAlert(
|
||||
st(
|
||||
'toastMessages.unsupportedFileType',
|
||||
'Unsupported file type. Please select a valid file.'
|
||||
)
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
store.uploadState[name] = { fileName: file.name, status: 'uploading' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user