-
Notifications
You must be signed in to change notification settings - Fork 0
Chunked + background uploading #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Fix: correct percentage of uploading is now being shown
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to fix the build
src/App.tsx
Outdated
|
||
if ('SyncManager' in window) { | ||
navigator.serviceWorker.ready.then((reg) => { | ||
reg.sync.register('sync-uploads'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vercel geeft de volgende error op deze line:
src/App.tsx(20,25): error TS2339: Property 'sync' does not exist on type 'ServiceWorkerRegistration'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all browser support background uploading. See article: https://developer.mozilla.org/en-US/docs/Web/API/SyncManager
Added own definition based on mdn docs
src/services/challenge.service.tsx
Outdated
const registration = await navigator.serviceWorker.ready; | ||
|
||
if ('sync' in registration) { | ||
registration.sync.register('sync-uploads'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS error here:
src/services/challenge.service.tsx(61,7): error TS18046: 'registration.sync' is of type 'unknown'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all browser support background uploading. See article: https://developer.mozilla.org/en-US/docs/Web/API/SyncManager
Added own definition based on mdn docs
await db.uploads.add({ | ||
challengeId, | ||
attemptId, | ||
chunkIndex: String(chunkIndex), | ||
fileName, | ||
fileType, | ||
data: await chunk.arrayBuffer(), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another typescript error somewhere along here.
src/services/challenge.service.tsx(51,7): error TS2322: Type 'number' is not assignable to type 'string'.
No description provided.