Merge pull request #578 from vector-im/fix-progressbar

Fix progressbar not working on attachment uploads
This commit is contained in:
Bruno Windels 2021-11-10 11:17:02 +01:00 committed by GitHub
commit c47f872f6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,7 +69,14 @@ async function purgeOldCaches() {
} }
self.addEventListener('fetch', (event) => { self.addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request)); /*
service worker shouldn't handle xhr uploads because otherwise
the progress events won't fire.
This has to do with xhr not being supported in service workers.
*/
if (event.request.method === "GET") {
event.respondWith(handleRequest(event.request));
}
}); });
function isCacheableThumbnail(url) { function isCacheableThumbnail(url) {