Open file import

Summary: This change only adds the PWA as capable of handling files with the ".flipper" extension.

Reviewed By: aigoncharov

Differential Revision: D48353437

fbshipit-source-id: fd78942ac4dffb7d26d5ca5be826290018465b93
This commit is contained in:
Lorenzo Blasa
2023-08-17 13:46:08 -07:00
committed by Facebook GitHub Bot
parent 9728155cbf
commit ce13ee426f
13 changed files with 150 additions and 106 deletions

View File

@@ -52,8 +52,7 @@ self.addEventListener('fetch', (event) => {
}
// Always try the network first (try flipper server)
const networkResponse = await fetch(event.request);
return networkResponse;
return await fetch(event.request);
} catch (error) {
// Catch is only triggered if an exception is thrown, which is likely
// due to a network error.
@@ -62,8 +61,7 @@ self.addEventListener('fetch', (event) => {
console.log('Fetch failed; returning offline page instead.', error);
const cache = await caches.open(CACHE_NAME);
const cachedResponse = await cache.match(OFFLINE_URL);
return cachedResponse;
return await cache.match(OFFLINE_URL);
}
})());
}