|  | @ -133,13 +133,6 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |       ]; |  |  |       ]; | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     this.route.queryParams |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       .pipe(takeUntil(this.unsubscribeSubject)) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       .subscribe((params) => { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         if (params['userId']) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |           this.openUserDetailDialog(params['userId']); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       }); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     this.userService.stateChanged |  |  |     this.userService.stateChanged | 
			
		
	
		
		
			
				
					|  |  |       .pipe(takeUntil(this.unsubscribeSubject)) |  |  |       .pipe(takeUntil(this.unsubscribeSubject)) | 
			
		
	
	
		
		
			
				
					|  | @ -169,6 +162,23 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   public ngOnInit() { |  |  |   public ngOnInit() { | 
			
		
	
		
		
			
				
					|  |  |     this.fetchUsers(); |  |  |     this.fetchUsers(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     // Handle route parameter changes when component is reused
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     this.route.params | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       .pipe(takeUntil(this.unsubscribeSubject)) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       .subscribe((params) => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         if (params['userId']) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           // If data is already loaded, open dialog immediately
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           if (this.dataSource.data.length > 0) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             this.openUserDetailDialog(params['userId']); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           } else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             // If data is not loaded yet, wait for it to load
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             this.fetchUsers().then(() => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |               this.openUserDetailDialog(params['userId']); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       }); | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   public formatDistanceToNow(aDateString: string) { |  |  |   public formatDistanceToNow(aDateString: string) { | 
			
		
	
	
		
		
			
				
					|  | @ -245,10 +255,7 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   public onOpenUserDetailDialog(userId: string) { |  |  |   public onOpenUserDetailDialog(userId: string) { | 
			
		
	
		
		
			
				
					
					|  |  |     this.router.navigate([], { |  |  |     this.router.navigate(['./', userId], { relativeTo: this.route }); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |       relativeTo: this.route, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       queryParams: { userId } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     }); |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   public ngOnDestroy() { |  |  |   public ngOnDestroy() { | 
			
		
	
	
		
		
			
				
					|  | @ -256,27 +263,30 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |     this.unsubscribeSubject.complete(); |  |  |     this.unsubscribeSubject.complete(); | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |   private fetchUsers({ pageIndex }: { pageIndex: number } = { pageIndex: 0 }) { |  |  |   private fetchUsers({ pageIndex }: { pageIndex: number } = { pageIndex: 0 }): Promise<void> { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |     this.isLoading = true; |  |  |     this.isLoading = true; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     if (pageIndex === 0 && this.paginator) { |  |  |     if (pageIndex === 0 && this.paginator) { | 
			
		
	
		
		
			
				
					|  |  |       this.paginator.pageIndex = 0; |  |  |       this.paginator.pageIndex = 0; | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     this.adminService |  |  |     return new Promise((resolve) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       .fetchUsers({ |  |  |       this.adminService | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         skip: pageIndex * this.pageSize, |  |  |         .fetchUsers({ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         take: this.pageSize |  |  |           skip: pageIndex * this.pageSize, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       }) |  |  |           take: this.pageSize | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       .pipe(takeUntil(this.unsubscribeSubject)) |  |  |         }) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       .subscribe(({ count, users }) => { |  |  |         .pipe(takeUntil(this.unsubscribeSubject)) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         this.dataSource = new MatTableDataSource(users); |  |  |         .subscribe(({ count, users }) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         this.totalItems = count; |  |  |           this.dataSource = new MatTableDataSource(users); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 
 |  |  |           this.totalItems = count; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         this.isLoading = false; |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 
 |  |  |           this.isLoading = false; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         this.changeDetectorRef.markForCheck(); |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       }); |  |  |           this.changeDetectorRef.markForCheck(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |           resolve(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     }); | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   private openUserDetailDialog(userId: string) { |  |  |   private openUserDetailDialog(userId: string) { | 
			
		
	
	
		
		
			
				
					|  | @ -285,10 +295,7 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |     }); |  |  |     }); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     if (!userData) { |  |  |     if (!userData) { | 
			
		
	
		
		
			
				
					
					|  |  |       this.router.navigate([], { |  |  |       this.router.navigate(['../'], { relativeTo: this.route }); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |         relativeTo: this.route, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         queryParams: {} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       }); |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |       return; |  |  |       return; | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | @ -308,10 +315,7 @@ export class GfAdminUsersComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |       .pipe(takeUntil(this.unsubscribeSubject)) |  |  |       .pipe(takeUntil(this.unsubscribeSubject)) | 
			
		
	
		
		
			
				
					|  |  |       .subscribe(() => { |  |  |       .subscribe(() => { | 
			
		
	
		
		
			
				
					|  |  |         this.fetchUsers(); |  |  |         this.fetchUsers(); | 
			
		
	
		
		
			
				
					
					|  |  |         this.router.navigate([], { |  |  |         this.router.navigate(['../'], { relativeTo: this.route }); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |           relativeTo: this.route, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |           queryParams: {} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         }); |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |       }); |  |  |       }); | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
	
		
		
			
				
					|  | 
 |