From 39005ad759aa02eb732fe46e8e5a3853635c85bc Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 30 Nov 2018 10:12:30 -0500 Subject: [PATCH] set route with router.navigate --- jslib | 2 +- src/app/vault/vault.component.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jslib b/jslib index 739d308498..5609fecbce 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 739d308498ab68df3e37772265733c81b27f2cc2 +Subproject commit 5609fecbcee6d0608ea28985c31688511e735a59 diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index 2b5ddca7d6..e3b6514b0e 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -1,6 +1,5 @@ import { remote } from 'electron'; -import { Location } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -75,7 +74,7 @@ export class VaultComponent implements OnInit, OnDestroy { private modal: ModalComponent = null; - constructor(private route: ActivatedRoute, private router: Router, private location: Location, + constructor(private route: ActivatedRoute, private router: Router, private componentFactoryResolver: ComponentFactoryResolver, private i18nService: I18nService, private broadcasterService: BroadcasterService, private changeDetectorRef: ChangeDetectorRef, private ngZone: NgZone, private syncService: SyncService, private analytics: Angulartics2, @@ -570,8 +569,11 @@ export class VaultComponent implements OnInit, OnDestroy { }; } - const url = this.router.createUrlTree(['vault'], { queryParams: queryParams }).toString(); - this.location.go(url); + this.router.navigate([], { + relativeTo: this.route, + queryParams: queryParams, + replaceUrl: true, + }); } private addCipherWithChangeDetection(type: CipherType = null) {