use router.navigate rather than location

This commit is contained in:
Kyle Spearrin 2018-11-30 10:28:46 -05:00
parent 9a99a95b15
commit dd282383d7
3 changed files with 15 additions and 14 deletions

2
jslib

@ -1 +1 @@
Subproject commit 2a960da31cda2e0fdc2f891dd6ff835bcb32d074
Subproject commit 5609fecbcee6d0608ea28985c31688511e735a59

View File

@ -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,
});
}
}

View File

@ -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,
});
}
}