Skip to content

Commit

Permalink
Update community.component.ts
Browse files Browse the repository at this point in the history
spacing fix
  • Loading branch information
jessewashburn authored Oct 31, 2024
1 parent 685a885 commit 1370526
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/app/community/community.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,18 @@ export class CommunityComponent implements OnInit, OnDestroy {
const newsSortValue = (item: any) => item.sharedDate || item.doc.time;
this.isLoading = true;
this.getCommunityData();

this.newsService.newsUpdated$.pipe(takeUntil(this.onDestroy$)).subscribe(news => {
this.news = news.sort((a, b) => newsSortValue(b) - newsSortValue(a));
this.isLoading = false;
});

this.usersService.usersListener(true).pipe(takeUntil(this.onDestroy$)).subscribe(users => {
if (!this.planetCode) {
this.setCouncillors(users);
}
});

this.stateService.couchStateListener('child_users').pipe(takeUntil(this.onDestroy$)).subscribe(childUsers => {
if (this.planetCode && childUsers) {
const users = childUsers.newData
.filter(user => user.planetCode === this.planetCode)
.map(user => ({ ...user, doc: user }));
const users = childUsers.newData.filter(user => user.planetCode === this.planetCode).map(user => ({ ...user, doc: user }));
this.setCouncillors(users);
}
});
Expand Down

0 comments on commit 1370526

Please sign in to comment.