From cdd0440402c168ff58f37d14e124d53fc011fef8 Mon Sep 17 00:00:00 2001 From: JTH Date: Fri, 30 Sep 2022 20:12:53 +0200 Subject: [PATCH] Redirect to archive if topic is gone --- quickmod.user.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/quickmod.user.js b/quickmod.user.js index 8307483..8dbbd14 100644 --- a/quickmod.user.js +++ b/quickmod.user.js @@ -114,6 +114,13 @@ function prefixSubject(input, reason) { return subject.slice(0, maxLen); } +function redirectToArchive() { + /* TODO: Make the location configurable, redirect to homepage, "Aktive + * Themen", "Neue Beiträge", or other? + */ + window.location = `./viewforum.php?f=${ARCHIVFORUMID}`; +} + async function remove_post_handler(event) { const post = event.currentTarget.closest('.post'); const usernameElem = post.querySelector(".author .username,.author .username-coloured"); @@ -210,10 +217,7 @@ function updatePageAfterSplit(post) { if (document.querySelectorAll(".post").length > 1) { post.parentNode.removeChild(post); } else { - /* TODO: Make the location configurable, redirect to homepage, "Aktive - * Themen", "Neue Beiträge", or other? - */ - window.location = "/"; + redirectToArchive(); } } -- 2.39.2