From a9a581adcb04e5a4e9ae8195dfaa38823fa3a366 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 8 Dec 2017 14:57:40 +0900 Subject: [PATCH] Revert "Fix #952" This reverts commit 8c70c9d6a0290c0d09e53e4a550d3e28c33059d2. --- src/web/app/boot.js | 4 --- .../app/common/scripts/check-for-update.ts | 4 --- src/web/assets/404.js | 4 --- src/web/assets/recover.html | 34 +++++++++++++++++++ src/web/server.ts | 2 ++ 5 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 src/web/assets/recover.html diff --git a/src/web/app/boot.js b/src/web/app/boot.js index 211dc2f883..0a3154ad88 100644 --- a/src/web/app/boot.js +++ b/src/web/app/boot.js @@ -95,10 +95,6 @@ // Clear cache (serive worker) try { navigator.serviceWorker.controller.postMessage('clear'); - - navigator.serviceWorker.getRegistrations().then(registrations => { - registrations.forEach(registration => registration.unregister()); - }); } catch (e) { console.error(e); } diff --git a/src/web/app/common/scripts/check-for-update.ts b/src/web/app/common/scripts/check-for-update.ts index 0b58c0a674..1540924510 100644 --- a/src/web/app/common/scripts/check-for-update.ts +++ b/src/web/app/common/scripts/check-for-update.ts @@ -11,10 +11,6 @@ export default async function(mios: MiOS) { // Clear cache (serive worker) try { navigator.serviceWorker.controller.postMessage('clear'); - - navigator.serviceWorker.getRegistrations().then(registrations => { - registrations.forEach(registration => registration.unregister()); - }); } catch (e) { console.error(e); } diff --git a/src/web/assets/404.js b/src/web/assets/404.js index 285704d113..46fd004f14 100644 --- a/src/web/assets/404.js +++ b/src/web/assets/404.js @@ -5,10 +5,6 @@ if (yn) { // Clear cache (serive worker) try { navigator.serviceWorker.controller.postMessage('clear'); - - navigator.serviceWorker.getRegistrations().then(registrations => { - registrations.forEach(registration => registration.unregister()); - }); } catch (e) { console.error(e); } diff --git a/src/web/assets/recover.html b/src/web/assets/recover.html new file mode 100644 index 0000000000..019f57b2e7 --- /dev/null +++ b/src/web/assets/recover.html @@ -0,0 +1,34 @@ + + + + + + Misskeyのリカバリ + + + diff --git a/src/web/server.ts b/src/web/server.ts index 5b09788b2d..1d3687f89e 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -44,6 +44,8 @@ app.use('/assets', (req, res) => { res.sendStatus(404); }); +app.use('/recover', (req, res) => res.sendFile(`${__dirname}/assets/recover.html`)); + /** * ServiceWroker */