@@ -119,12 +119,8 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
ngAfterViewInit() {
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
- if (this.paramsSubscription instanceof Subscription) {
- this.paramsSubscription.unsubscribe();
- }
this.paramsSubscription = this.route.queryParams.subscribe(params => {
if (params) {
- this.isMember = !!params['isMember'];
this.cdr.detectChanges();
if(params['verify'] && !this.isMember) {
if (this.user) {
@@ -133,7 +129,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) {
if (this.verification.verificationType === 'manager') {
this.openManagerModal();
- } else if (this.verification.verificationType === 'member' && this.service === "monitor") {
+ } else if (this.verification.verificationType === 'member') {
this.openMemberModal();
} else {
this.openErrorModal();
@@ -217,6 +213,9 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
this.managerModal.cancel();
this.error = null;
this.userManagementService.updateUserInfo(() => {
+ if (this.paramsSubscription instanceof Subscription) {
+ this.paramsSubscription.unsubscribe();
+ }
if (this.service === "monitor") {
this.loading = false;
this.router.navigate(['/admin/' + this.verification.entity]);
@@ -254,8 +253,12 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
this.clearCacheService.clearCache('Members updated');
this.loading = false;
this.error = null;
+ this.isMember = true;
this.userManagementService.updateUserInfo(() => {
- this.router.navigate([], {queryParams: {'verify': null, 'isMember': true}});
+ if (this.paramsSubscription instanceof Subscription) {
+ this.paramsSubscription.unsubscribe();
+ }
+ this.cancel();
});
}, error => {
this.loading = false;
@@ -271,6 +274,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
}
cancel() {
- this.router.navigate([], {queryParams: {'verify': null, 'isMember': null}});
+ this.isMember = false;
+ this.router.navigate([]);
}
}