From 3f689a322c99f02f7a8064cc84a50acc00ee8ade Mon Sep 17 00:00:00 2001 From: Felix <felix.strick@udo.edu> Date: Sun, 19 Mar 2023 11:37:06 +0100 Subject: [PATCH] Fix 404 --- public/404.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/404.html b/public/404.html index ad743cc..b91e8aa 100644 --- a/public/404.html +++ b/public/404.html @@ -76,10 +76,10 @@ const results = fuse.search(pathToSearchFor) if (results.length !== 0) { const bestShortlink = results[0].item; - const bestHref = vanityMap[bestShortlink]; + const bestHref = vanityMap['shortlinks'].filter((object) => object.sources.includes(bestShortlink))[0].destination; document.getElementById("suggestion-text").innerText = "/" + bestShortlink; - document.getElementById("suggestion-href").href = "/" + bestHref; + document.getElementById("suggestion-href").href = bestHref; document.getElementById("suggestion-section").classList.remove("is-invisible"); } } -- GitLab