Skip to content

Commit

Permalink
Remove localhost changes, only refresh when online in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
RayBB authored Nov 22, 2024
1 parent c98d6f7 commit 7a5c93c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions static/offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,7 @@
a{margin: 8px; padding: 4px 8px; background: #e44028; color: white; border-radius: 4px; text-decoration: none;}
a.goback{background: #0376b8;}
</style>
<script>
window.addEventListener('online', () => location.reload());
if (location.hostname === 'localhost') {
setInterval(async () => {
try {
const response = await fetch('/');
if (response.ok) location.reload();
} catch (e) {
// Connection still not available
}
}, 1000);
}
</script>
<script>window.addEventListener('online', () => location.reload());</script>
</head>
<body>
<div id="logo"><img src="static/images/logo_OL-err.png" alt="The Open Library is closed!" width="219"/></div>
Expand Down

0 comments on commit 7a5c93c

Please sign in to comment.