Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
fix(back-button): fix configurable root
Browse files Browse the repository at this point in the history
  • Loading branch information
garygrossgarten committed Mar 16, 2019
1 parent 487bd64 commit adaf316
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/core/src/lib/services/routing-state.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NavController, Platform } from '@ionic/angular';

export interface RoutingStateConfig {
clearOnRoot?: boolean;
root: '/';
root: string;
}

@Injectable({
Expand Down Expand Up @@ -33,7 +33,7 @@ export class FivRoutingStateService {
.subscribe(({ urlAfterRedirects }: NavigationEnd) => {
// add url to history
this.history = [...this.history, urlAfterRedirects];
if (this.config && this.config.clearOnRoot && urlAfterRedirects === this.config.root) {
if (this.config && this.config.clearOnRoot && urlAfterRedirects === (this.config.root || '/')) {
// clear on root
this.clearHistory();
}
Expand Down

0 comments on commit adaf316

Please sign in to comment.