1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-05 02:08:56 +09:00

Merge branch 'develop' of https://github.com/syuilo/misskey into develop

This commit is contained in:
syuilo 2020-02-09 18:53:31 +09:00
commit 23e7650983
3 changed files with 26 additions and 2 deletions

View File

@ -18,7 +18,7 @@ self.addEventListener('install', ev => {
caches.open(cacheName)
.then(cache => {
return cache.addAll([
'/'
`/?v=${version}`
]);
})
.then(() => self.skipWaiting())
@ -45,7 +45,7 @@ self.addEventListener('fetch', ev => {
return response || fetch(ev.request);
})
.catch(() => {
return caches.match('/');
return caches.match(`/?v=${version}`);
})
);
});

View File

@ -327,6 +327,10 @@ const override = (source: string, target: string, depth: number = 0) =>
router.get('/othello', async ctx => ctx.redirect(override(ctx.URL.pathname, 'games/reversi', 1)));
router.get('/reversi', async ctx => ctx.redirect(override(ctx.URL.pathname, 'games')));
router.get('/flash', async ctx => {
await ctx.render('flash');
});
// Render base html for all requests
router.get('*', async ctx => {
const meta = await fetchMeta();

View File

@ -0,0 +1,20 @@
doctype html
html
script.
localStorage.removeItem('locale');
try {
navigator.serviceWorker.controller.postMessage('clear');
navigator.serviceWorker.getRegistrations().then(registrations => {
return Promise.all(registrations.map(registration => registration.unregister()));
}).then(() => {
location = '/';
});
} catch (e) {
console.error(e);
setTimeout(() => {
location = '/';
}, 10000)
}