From cc028ec045de4874381c1bb9a4bb05967a3e993a Mon Sep 17 00:00:00 2001 From: Martin Jonasson Date: Mon, 1 Jul 2019 11:28:32 +0200 Subject: [PATCH] fix(navigation-plan): add query string from redirect instruction --- src/navigation-plan.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/navigation-plan.ts b/src/navigation-plan.ts index 06707cac..4d5a9e24 100644 --- a/src/navigation-plan.ts +++ b/src/navigation-plan.ts @@ -81,6 +81,14 @@ export const buildRedirectPlan = (instruction: NavigationInstruction) => { let queryString = instruction.queryString; if (queryString) { redirectLocation += '?' + queryString; + } + let redirectQueryString = redirectInstruction.queryString; + if (redirectQueryString) { + if (queryString) { + redirectLocation += '&' + redirectQueryString; + } else { + redirectLocation += '?' + redirectQueryString; + } } return Promise.resolve(new Redirect(redirectLocation));