From 833281861692ec265ac94731716c186d213083c8 Mon Sep 17 00:00:00 2001 From: merefield Date: Wed, 6 Sep 2023 13:29:21 +0100 Subject: [PATCH] FEATURE: implement way to temporarily ignore redirect --- .../discourse/initializers/custom-wizard-redirect.js.es6 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 b/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 index 70676bb0..16e4205a 100644 --- a/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 +++ b/assets/javascripts/discourse/initializers/custom-wizard-redirect.js.es6 @@ -22,6 +22,7 @@ export default { withPluginApi("0.8.36", (api) => { api.onAppEvent("page:changed", (data) => { const currentUser = api.getCurrentUser(); + const searchParams = new URLSearchParams(window.location.search); if (currentUser) { const redirectToWizard = currentUser.redirect_to_wizard; @@ -30,6 +31,7 @@ export default { .concat(["loading"]); if ( redirectToWizard && + !searchParams.has('ignore_redirect') && data.currentRouteName !== "customWizardStep" && !excludedPaths.find((p) => { return data.currentRouteName.indexOf(p) > -1;