From dd282383d76c75f7a94752f86c2b8028894cb943 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 30 Nov 2018 10:28:46 -0500 Subject: [PATCH] use router.navigate rather than location --- jslib | 2 +- src/app/organizations/vault/vault.component.ts | 14 +++++++------- src/app/vault/vault.component.ts | 13 +++++++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/jslib b/jslib index 2a960da31cd..5609fecbcee 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 2a960da31cda2e0fdc2f891dd6ff835bcb32d074 +Subproject commit 5609fecbcee6d0608ea28985c31688511e735a59 diff --git a/src/app/organizations/vault/vault.component.ts b/src/app/organizations/vault/vault.component.ts index 1aca5b5e6a2..19a0abc97c9 100644 --- a/src/app/organizations/vault/vault.component.ts +++ b/src/app/organizations/vault/vault.component.ts @@ -1,4 +1,3 @@ -import { Location } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -56,11 +55,10 @@ export class VaultComponent implements OnInit, OnDestroy { private modal: ModalComponent = null; constructor(private route: ActivatedRoute, private userService: UserService, - private location: Location, private router: Router, + private router: Router, private changeDetectorRef: ChangeDetectorRef, private syncService: SyncService, private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver, private messagingService: MessagingService, - private broadcasterService: BroadcasterService, private ngZone: NgZone, - private changeDetectorRef: ChangeDetectorRef) { } + private broadcasterService: BroadcasterService, private ngZone: NgZone) { } ngOnInit() { this.route.parent.params.subscribe(async (params) => { @@ -295,8 +293,10 @@ export class VaultComponent implements OnInit, OnDestroy { }; } - const url = this.router.createUrlTree(['organizations', this.organization.id, 'vault'], - { queryParams: queryParams }).toString(); - this.location.go(url); + this.router.navigate([], { + relativeTo: this.route, + queryParams: queryParams, + replaceUrl: true, + }); } } diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index 1edad37abf4..a9243c275b3 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -1,4 +1,3 @@ -import { Location } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -77,13 +76,12 @@ export class VaultComponent implements OnInit, OnDestroy { private modal: ModalComponent = null; constructor(private syncService: SyncService, private route: ActivatedRoute, - private router: Router, private location: Location, + private router: Router, private changeDetectorRef: ChangeDetectorRef, private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver, private tokenService: TokenService, private cryptoService: CryptoService, private messagingService: MessagingService, private userService: UserService, private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService, - private broadcasterService: BroadcasterService, private ngZone: NgZone, - private changeDetectorRef: ChangeDetectorRef) { } + private broadcasterService: BroadcasterService, private ngZone: NgZone) { } async ngOnInit() { this.showVerifyEmail = !(await this.tokenService.getEmailVerified()); @@ -480,7 +478,10 @@ 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, + }); } }