mirror of
https://github.com/Timwi/KtaneWeb.git
synced 2024-07-27 03:32:15 +01:00
Fix redirect page for people who have no preferredManuals in localStorage
This commit is contained in:
parent
05faa474b6
commit
d40e934326
@ -18,7 +18,7 @@
|
||||
let inf = JSON.parse(localStorage.getItem('preferredManuals'));
|
||||
let hash = decodeURIComponent(location.hash.substring(1));
|
||||
let div = document.getElementById('result');
|
||||
let redirectTo = hash in inf
|
||||
let redirectTo = inf && hash in inf
|
||||
? `${hash} ${inf[hash].replace(/ \((HTML|PDF)\)$/, (_, e) => `.${e.toLowerCase()}`)}`
|
||||
: `${hash}.html`;
|
||||
window.location.replace(`../HTML/${encodeURIComponent(redirectTo)}`);
|
||||
|
Loading…
Reference in New Issue
Block a user