refactor: consolidate upload helpers

This commit is contained in:
Tom Boullay
2026-04-27 17:20:54 +02:00
parent 43cf48cc7d
commit d049318a73
11 changed files with 38 additions and 38 deletions
+2 -6
View File
@@ -1,6 +1,7 @@
'use client'
import type { FolderEntry } from '@/lib/client-types'
import { revokeEntryUrls } from '@/lib/client-object-urls'
import { useSecret } from '@/hooks/useSecret'
import { useFolderEntries } from '@/hooks/useFolderEntries'
import { useUploadOrchestrator } from '@/hooks/useUploadOrchestrator'
@@ -60,12 +61,7 @@ export default function UploadZone() {
})
const handleFolderSelected = (entry: FolderEntry) => {
entries.forEach((current) => {
const urls = new Set<string>()
if (current.modelUrl) urls.add(current.modelUrl)
Object.values(current.assetUrls || {}).forEach((url) => urls.add(url))
urls.forEach((url) => URL.revokeObjectURL(url))
})
entries.forEach(revokeEntryUrls)
setGlobalError(null)
setEntries([entry])
}