Skip to content

Commit 7166194

Browse files
davidtaylorhqNullVoxPopuli
authored andcommitted
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 emberjs/router.js#335 lands, it will means we can take advantage of that fix for ApplicationInstance#visit.
1 parent dc6b531 commit 7166194

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

packages/@ember/application/instance.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,6 @@ class ApplicationInstance extends EngineInstance {
263263
let handleTransitionReject = (error: any): unknown => {
264264
if (error.error && error.error instanceof Error) {
265265
throw error.error;
266-
} else if (error.name === 'TransitionAborted' && router._routerMicrolib.activeTransition) {
267-
return router._routerMicrolib.activeTransition.then(
268-
handleTransitionResolve,
269-
handleTransitionReject
270-
);
271266
} else if (error.name === 'TransitionAborted') {
272267
throw new Error(error.message);
273268
} else {
@@ -284,6 +279,7 @@ class ApplicationInstance extends EngineInstance {
284279
// getURL returns the set url with the rootURL stripped off
285280
return router
286281
.handleURL(location.getURL())
282+
.followRedirects()
287283
.then(handleTransitionResolve, handleTransitionReject);
288284
}
289285

0 commit comments

Comments
 (0)