Skip to content

Commit

Permalink
Add service-worker script to static assets, update og:image to perman…
Browse files Browse the repository at this point in the history
…ent link
  • Loading branch information
big213 committed Apr 14, 2021
1 parent c887008 commit 1b60dbe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
},
{
property: 'og:image',
content: 'https://cubepb.com/_nuxt/img/cubepb-logo-2-b.2c3896b.png',
content: 'https://cubepb.com/cubepb-logo-2-b.png',
},
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
Expand Down
18 changes: 18 additions & 0 deletions frontend/static/service-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
self.addEventListener('activate', function (event) {
event.waitUntil(
caches.keys().then(function (cacheNames) {
return Promise.all(
cacheNames
.filter(function (_cacheName) {
// Return true if you want to remove this cache,
// but remember that caches are shared across
// the whole origin
return true
})
.map(function (cacheName) {
return caches.delete(cacheName)
})
)
})
)
})

0 comments on commit 1b60dbe

Please sign in to comment.