Fix #952
This commit is contained in:
@@ -2,6 +2,13 @@ const yn = window.confirm(
|
||||
'サーバー上に存在しないスクリプトがリクエストされました。お使いのMisskeyのバージョンが古いことが原因の可能性があります。Misskeyを更新しますか?');
|
||||
|
||||
if (yn) {
|
||||
// Clear cache (serive worker)
|
||||
try {
|
||||
navigator.serviceWorker.controller.postMessage('clear');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
location.reload(true);
|
||||
} else {
|
||||
alert('問題が解決しない場合はサーバー管理者までお問い合せください。');
|
32
src/web/assets/recover.html
Normal file
32
src/web/assets/recover.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Misskeyのリカバリ</title>
|
||||
<script>
|
||||
|
||||
const yn = window.confirm('キャッシュをクリアしますか?\y\yDo 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('キャッシュをクリアしました。');
|
||||
} else {
|
||||
alert('問題が解決しない場合はサーバー管理者までお問い合せください。');
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
Reference in New Issue
Block a user