mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
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>
30 lines
660 B
JavaScript
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}`)
|
|
})
|
|
}
|