Explicitly type service worker registration
Summary: Per title. Reviewed By: danielbuechele Differential Revision: D15601531 fbshipit-source-id: 251949faffd75cf8b59a71c3963230113b0ebb0c
This commit is contained in:
committed by
Facebook Github Bot
parent
f81d46410b
commit
c5a6ed0839
@@ -54,8 +54,13 @@ function init() {
|
||||
? path.join(__dirname, 'serviceWorker.js')
|
||||
: './serviceWorker.js',
|
||||
)
|
||||
.then(r => {
|
||||
(r.installing || r.active).postMessage({precachedIcons});
|
||||
.then((r: ServiceWorkerRegistration) => {
|
||||
const client = r.installing || r.active;
|
||||
if (client != null) {
|
||||
client.postMessage({precachedIcons});
|
||||
} else {
|
||||
console.error('Service worker registration failed: ', r);
|
||||
}
|
||||
})
|
||||
.catch(console.error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user