File tree 1 file changed +2
-13
lines changed
1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -12,33 +12,22 @@ import { OLD_WIKI_URL, OLD_WIKI_REDIRECT } from '@src/content.constants';
12
12
}
13
13
}} >
14
14
{ 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 >
19
16
)}
20
17
</StarlightPage >
21
18
22
19
<script is:inline define:vars ={ { OLD_WIKI_URL , OLD_WIKI_REDIRECT }} >
23
20
if (!OLD_WIKI_REDIRECT) {
24
21
return;
25
22
}
26
- const gotoUrl = OLD_WIKI_URL + location.pathname;
27
23
let countdown = 5;
28
24
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
-
36
25
const interval = setInterval(() => {
37
26
countdown -= 1;
38
27
if (el) el.textContent = countdown;
39
28
if (countdown <= 0) {
40
29
clearInterval(interval);
41
- window.location.href = gotoUrl ;
30
+ window.location.replace(OLD_WIKI_URL + location.pathname) ;
42
31
}
43
32
}, 1000);
44
33
</script >
You can’t perform that action at this time.
0 commit comments