Skip to content

Commit 52b1d0b

Browse files
Fix 404 page
1 parent 3291539 commit 52b1d0b

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

web/src/pages/404.astro

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,22 @@ import { OLD_WIKI_URL, OLD_WIKI_REDIRECT } from '@src/content.constants';
1212
}
1313
}}>
1414
{OLD_WIKI_REDIRECT && (
15-
<p>This page doesn't exist here. You will be redirected to the old MTA Wiki in <strong><span id="countdown">5</span> seconds...</p></strong>
16-
<a href="#" target="_blank" rel="noopener noreferrer">
17-
<p>Click here to view the page on the old MTA Wiki</p>
18-
</a>
15+
<h4>You will be redirected to the old MTA Wiki in <strong><span id="countdown">5</span> seconds...</strong></h4>
1916
)}
2017
</StarlightPage>
2118

2219
<script is:inline define:vars={{ OLD_WIKI_URL, OLD_WIKI_REDIRECT }}>
2320
if (!OLD_WIKI_REDIRECT) {
2421
return;
2522
}
26-
const gotoUrl = OLD_WIKI_URL + location.pathname;
2723
let countdown = 5;
2824
const el = document.getElementById('countdown');
29-
const aEl = document.querySelector('a');
30-
aEl.onclick = (e) => {
31-
e.preventDefault();
32-
clearInterval(interval);
33-
window.location.href = gotoUrl;
34-
};
35-
3625
const interval = setInterval(() => {
3726
countdown -= 1;
3827
if (el) el.textContent = countdown;
3928
if (countdown <= 0) {
4029
clearInterval(interval);
41-
window.location.href = gotoUrl;
30+
window.location.replace(OLD_WIKI_URL + location.pathname);
4231
}
4332
}, 1000);
4433
</script>

0 commit comments

Comments
 (0)