mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-28 05:23:08 +02:00
Add recover.html again
This commit is contained in:
parent
4ec94696fe
commit
40b6797933
1 changed files with 28 additions and 0 deletions
28
src/client/assets/recover.html
Normal file
28
src/client/assets/recover.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Misskeyのリカバリ</title>
|
||||
<script>
|
||||
const yn = window.confirm('キャッシュをクリアしますか?(他のタブでMisskeyを開いている状態だと正常にクリアできないので、他のMisskeyのタブをすべて閉じてから行ってください)\n\nDo you want to clear caches? (Please close all other Misskey tabs before clear cache)');
|
||||
if (yn) {
|
||||
try {
|
||||
navigator.serviceWorker.controller.postMessage('clear');
|
||||
navigator.serviceWorker.getRegistrations().then(registrations => {
|
||||
registrations.forEach(registration => registration.unregister());
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
alert('キャッシュをクリアしました。\n\ncache cleared.');
|
||||
alert('まもなくページを再度読み込みします。再度読み込みが終わると、再度キャッシュをクリアするか尋ねられるので、「キャンセル」を選択して抜けてください。\n\nWe will reload the page shortly. After that, you are asked whether you want to clear the cache again, so please select "Cancel" and exit.');
|
||||
setTimeout(() => {
|
||||
location.reload(true);
|
||||
}, 100);
|
||||
} else {
|
||||
location.href = '/';
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
Loading…
Reference in a new issue