From ceafadeb534a90cb80a097cd7d4735aa3515457a Mon Sep 17 00:00:00 2001 From: Dane Hillard Date: Wed, 10 Jul 2024 12:32:57 -0400 Subject: [PATCH] Update routing check to catch more cases --- src/main.ts | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/main.ts b/src/main.ts index 34feb1f3c..846ff3dc3 100755 --- a/src/main.ts +++ b/src/main.ts @@ -112,26 +112,22 @@ fetch('/unfederated-session-service/query', { const currentRequest = window.location.href; - if (currentRequest.includes('/#/')) { - const params = new URLSearchParams({ artstorPath: currentRequest }).toString(); + const params = new URLSearchParams({ artstorPath: currentRequest }).toString(); - fetch(`/get-the-redirect-please/?${params}`) - .then(redirectResponse => redirectResponse.json()) - .then(redirectData => { - if (redirectData.location) { - if (doRedirect) { - console.log('Redirecting to:', redirectData.location); - window.location.replace(redirectData.location); - } else { - console.log('Will eventually redirect to:', redirectData.location); - initializeApp(); - } + fetch(`/get-the-redirect-please/?${params}`) + .then(redirectResponse => redirectResponse.json()) + .then(redirectData => { + if (redirectData.location) { + if (doRedirect) { + console.log('Redirecting to:', redirectData.location); + window.location.replace(redirectData.location); } else { + console.log('Will eventually redirect to:', redirectData.location); initializeApp(); } - }); - } else { - initializeApp(); - } + } else { + initializeApp(); + } + }); }); });