Skip to content

Commit

Permalink
added condition to not render logged in user
Browse files Browse the repository at this point in the history
  • Loading branch information
Gururajj77 committed Jan 13, 2024
1 parent 63642cd commit 0f7d0c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/app/users/users.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<section class="user-container">
@for (user of usersWithFollowStatus$ | async; track $index) {
@for (user of usersWithFollowStatus$ | async; track $index) { @if
(user.uid!==uid) {
<div class="user-item">
<div class="author-info">
<div class="author-image">
Expand Down Expand Up @@ -35,5 +36,5 @@ <h3>{{ user.name }}</h3>
}
</div>
</div>
}
} }
</section>
3 changes: 2 additions & 1 deletion src/app/users/users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class UsersComponent {

private readonly firestore: FirestoreService = inject(FirestoreService);
private readonly auth: Auth = inject(Auth);

uid: string | undefined = "";
users$: Observable<User[]> = of([]);
followingUids$: Observable<string[]> = of([]);
usersWithFollowStatus$: Observable<any[]> = of([]);
Expand All @@ -25,6 +25,7 @@ export class UsersComponent {
ngOnInit() {
this.getUsersList();
this.checkFollowStatus();
this.uid = this.auth.currentUser?.uid
}

checkFollowStatus() {
Expand Down

0 comments on commit 0f7d0c6

Please sign in to comment.