uppy/private/dev/index.js
Mikael Finstad 0c16fe44b9
Golden retriever refactor and UppyFile type improvements (#5978)
Probably best reviewed commit by commit.

I also split UppyFile into two intefaces distinguished by the `isRemote`
boolean:
- LocalUppyFile
- RemoteUppyFile

Also:
- Removed the TagFile type
- Don't re-upload completed files - fixes #5930
- Clean up stored files on `complete` event *only* if *all* files
succeeded (no failed files). this allows the user to retry failed files
if the browser & upload get interrupted - fixes #5927, closes #5955
- Only set `isGhost` for non-successful files. it doesn't make sense for
successfully uploaded files to be ghosted because they're already done.
#5930

fixes #6013

---------

Co-authored-by: Prakash <qxprakash@gmail.com>
2025-10-17 23:17:40 +08:00

30 lines
660 B
JavaScript

import 'uppy/dist/uppy.css'
import Dashboard from './Dashboard.js'
import DragDrop from './DragDrop.js'
switch (window.location.pathname.toLowerCase()) {
case '/':
case '/dashboard.html':
Dashboard()
break
case '/dragdrop.html':
DragDrop()
break
default:
throw new Error('404')
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('./sw.js', { type: 'module' })
.then((registration) => {
console.log(
'ServiceWorker registration successful with scope: ',
registration.scope,
)
})
.catch((error) => {
console.log(`Registration failed with ${error}`)
})
}