summaryrefslogtreecommitdiff
path: root/src/web/assets
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-12-08 14:57:40 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-12-08 14:57:40 +0900
commita9a581adcb04e5a4e9ae8195dfaa38823fa3a366 (patch)
tree4f896fc92f0a87a26baad1ea4347ee1eac185237 /src/web/assets
parentFix #952 (diff)
downloadsharkey-a9a581adcb04e5a4e9ae8195dfaa38823fa3a366.tar.gz
sharkey-a9a581adcb04e5a4e9ae8195dfaa38823fa3a366.tar.bz2
sharkey-a9a581adcb04e5a4e9ae8195dfaa38823fa3a366.zip
Revert "Fix #952"
This reverts commit 8c70c9d6a0290c0d09e53e4a550d3e28c33059d2.
Diffstat (limited to 'src/web/assets')
-rw-r--r--src/web/assets/404.js4
-rw-r--r--src/web/assets/recover.html34
2 files changed, 34 insertions, 4 deletions
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 @@
+<!DOCTYPE html>
+
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Misskeyのリカバリ</title>
+ <script>
+
+ const yn = window.confirm('キャッシュをクリアしますか?\n\nDo you want to clear caches?');
+
+ if (yn) {
+ try {
+ navigator.serviceWorker.controller.postMessage('clear');
+
+ navigator.serviceWorker.getRegistrations().then(registrations => {
+ registrations.forEach(registration => registration.unregister());
+ });
+
+ } catch (e) {
+ console.error(e);
+ }
+
+ localStorage.setItem('should-refresh', 'true');
+
+ alert('キャッシュをクリアしました。');
+
+ location.href = '/';
+ } else {
+ alert('問題が解決しない場合はサーバー管理者までお問い合せください。');
+ }
+
+ </script>
+ </head>
+</html>