1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 17:23:22 +01:00

Merge pull request #17 from kremalicious/feature/remove-service-worker

Remove service worker properly
This commit is contained in:
Matthias Kretschmann 2018-07-14 14:24:44 +02:00 committed by GitHub
commit 17786bbe64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -21,7 +21,7 @@
}, },
"dependencies": { "dependencies": {
"file-saver": "^1.3.8", "file-saver": "^1.3.8",
"gatsby": "^2.0.0-beta.35", "gatsby": "^2.0.0-beta.36",
"gatsby-image": "^2.0.0-beta.6", "gatsby-image": "^2.0.0-beta.6",
"gatsby-plugin-favicon": "github:TuckerWhitehouse/gatsby-plugin-favicon#gatsby-v2", "gatsby-plugin-favicon": "github:TuckerWhitehouse/gatsby-plugin-favicon#gatsby-v2",
"gatsby-plugin-matomo": "^0.4.1", "gatsby-plugin-matomo": "^0.4.1",
@ -30,7 +30,7 @@
"gatsby-plugin-sass": "next", "gatsby-plugin-sass": "next",
"gatsby-plugin-sharp": "^2.0.0-beta.5", "gatsby-plugin-sharp": "^2.0.0-beta.5",
"gatsby-plugin-sitemap": "next", "gatsby-plugin-sitemap": "next",
"gatsby-source-filesystem": "^2.0.1-beta.4", "gatsby-source-filesystem": "^2.0.1-beta.5",
"gatsby-transformer-json": "next", "gatsby-transformer-json": "next",
"gatsby-transformer-sharp": "next", "gatsby-transformer-sharp": "next",
"gatsby-transformer-yaml": "next", "gatsby-transformer-yaml": "next",

14
static/sw.js Normal file
View File

@ -0,0 +1,14 @@
self.addEventListener('install', function() {
self.skipWaiting()
})
self.addEventListener('activate', function() {
self.registration
.unregister()
.then(function() {
return self.clients.matchAll()
})
.then(function(clients) {
clients.forEach(client => client.navigate(client.url))
})
})