Skip to content

Commit ae50eb4

Browse files
committed
Using computed navigationResolution
This change makes navigation for canceled navigation attempts, like CanDeactivate, navigate the opposite direction, instead of replacing the item in the history. Replacing the item in the history was corrupting the history when using location.back() and then canceling. I'm actually not sure why you would want to be messing with the history in the first place. 'computed' seems like the sensible option. If the user hits back, then cancels, the router cancels by going forward.
1 parent 051a28d commit ae50eb4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/app-routing.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ const routes: Routes = [
3737
];
3838

3939
@NgModule({
40-
imports: [RouterModule.forRoot(routes)],
40+
imports: [
41+
RouterModule.forRoot(routes, {
42+
canceledNavigationResolution: 'computed'
43+
})
44+
],
4145
exports: [RouterModule]
4246
})
4347
export class AppRoutingModule {}

0 commit comments

Comments
 (0)