From d364d098345378c6831acda0411dc4eb34b3aaff Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 16 Nov 2023 11:35:58 +0000 Subject: [PATCH] Update ApplicationInstance#visit to use followRedirects() The current implementation of `Transition#followRedirects()` is identical to the logic here: it catches rejections, and then checks for any other `activeTransition`. Therefore, this commit introduces no change in behavior. But, if/when https://github.com/tildeio/router.js/pull/335 lands, it will means we can take advantage of that fix for ApplicationInstance#visit. --- packages/@ember/application/instance.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/@ember/application/instance.ts b/packages/@ember/application/instance.ts index 11af0292375..b887b94f68a 100644 --- a/packages/@ember/application/instance.ts +++ b/packages/@ember/application/instance.ts @@ -264,11 +264,6 @@ class ApplicationInstance extends EngineInstance { let handleTransitionReject = (error: any): unknown => { if (error.error && error.error instanceof Error) { throw error.error; - } else if (error.name === 'TransitionAborted' && router._routerMicrolib.activeTransition) { - return router._routerMicrolib.activeTransition.then( - handleTransitionResolve, - handleTransitionReject - ); } else if (error.name === 'TransitionAborted') { throw new Error(error.message); } else { @@ -285,6 +280,7 @@ class ApplicationInstance extends EngineInstance { // getURL returns the set url with the rootURL stripped off return router .handleURL(location.getURL()) + .followRedirects() .then(handleTransitionResolve, handleTransitionReject); }