clean up code
							parent
							
								
									162453c894
								
							
						
					
					
						commit
						d1f53f78c9
					
				|  | @ -51,7 +51,6 @@ export class AwardUserComponent implements OnInit { | ||||||
|         .subscribe(id => this.userId = id); |         .subscribe(id => this.userId = id); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|   toggleDecoPreview(descriptionField, decorationId, image) { |   toggleDecoPreview(descriptionField, decorationId, image) { | ||||||
|     if (decorationId !== '0') { |     if (decorationId !== '0') { | ||||||
|       this.decoPreviewDisplay = 'flex'; // visible & keep same height for all children
 |       this.decoPreviewDisplay = 'flex'; // visible & keep same height for all children
 | ||||||
|  | @ -72,10 +71,10 @@ export class AwardUserComponent implements OnInit { | ||||||
|     const reason = reasonField.value; |     const reason = reasonField.value; | ||||||
|     if (decorationId && reason.length > 0) { |     if (decorationId && reason.length > 0) { | ||||||
|       const award = { |       const award = { | ||||||
|         'userId': this.userId, |         userId: this.userId, | ||||||
|         'decorationId': decorationId, |         decorationId: decorationId, | ||||||
|         'reason': reason, |         reason: reason, | ||||||
|         'date': Date.now() |         date: Date.now() | ||||||
|       }; |       }; | ||||||
|       this.awardingService.addAwarding(award).subscribe(() => { |       this.awardingService.addAwarding(award).subscribe(() => { | ||||||
|         this.awardingService.getUserAwardings(this.userId) |         this.awardingService.getUserAwardings(this.userId) | ||||||
|  |  | ||||||
|  | @ -53,7 +53,9 @@ export class EditUserComponent implements OnInit { | ||||||
|                                 user.squadId = '0'; |                                 user.squadId = '0'; | ||||||
|                                 this.ranksDisplay = 'none'; |                                 this.ranksDisplay = 'none'; | ||||||
|                               } else { |                               } else { | ||||||
|                                 this.rankService.findRanks('', user.squadId.fraction).subscribe(ranks => { |                                 this.rankService | ||||||
|  |                                     .findRanks('', user.squadId.fraction) | ||||||
|  |                                     .subscribe(ranks => { | ||||||
|                                       this.ranks = ranks; |                                       this.ranks = ranks; | ||||||
|                                       this.ranksDisplay = 'block'; |                                       this.ranksDisplay = 'block'; | ||||||
|                                     }); |                                     }); | ||||||
|  | @ -68,7 +70,9 @@ export class EditUserComponent implements OnInit { | ||||||
| 
 | 
 | ||||||
|   toggleRanks() { |   toggleRanks() { | ||||||
|     if (this.user.squadId !== '0') { |     if (this.user.squadId !== '0') { | ||||||
|       this.rankService.findRanks('', this.user.squadId.fraction).subscribe( |       this.rankService | ||||||
|  |           .findRanks('', this.user.squadId.fraction) | ||||||
|  |           .subscribe( | ||||||
|             ranks => { |             ranks => { | ||||||
|               this.ranks = ranks; |               this.ranks = ranks; | ||||||
|               this.ranksDisplay = 'block'; |               this.ranksDisplay = 'block'; | ||||||
|  |  | ||||||
|  | @ -34,6 +34,5 @@ export class UserItemComponent { | ||||||
|   delete() { |   delete() { | ||||||
|     this.userDelete.emit(this.user); |     this.userDelete.emit(this.user); | ||||||
|   } |   } | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -41,7 +41,6 @@ export class UserListComponent implements OnInit { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
| 
 |  | ||||||
|     this.users$ = this.userService.users$; |     this.users$ = this.userService.users$; | ||||||
| 
 | 
 | ||||||
|     const paramsStream = this.route.queryParams |     const paramsStream = this.route.queryParams | ||||||
|  | @ -106,5 +105,4 @@ export class UserListComponent implements OnInit { | ||||||
| 
 | 
 | ||||||
|     this.location.replaceState(absoluteUrl, queryPart); |     this.location.replaceState(absoluteUrl, queryPart); | ||||||
|   } |   } | ||||||
| 
 |  | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue