Skip to content

Commit

Permalink
fix: event list bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Feb 17, 2022
1 parent cb2015d commit e57a98f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/pages/Events/Content/EventsList/EventsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export class EventsList extends React.Component<any> {
{filteredEvents.map((event: IEventDB) => (
<EventCard
key={event._id}
verified={this.props.userStore?.verifiedUsers?.some(
user => user.userName === event._createdBy,
)}
verified={
this.injected.userStore?.verifiedUsers[event._createdBy]
}
event={event}
needsModeration={this.store.needsModeration(event)}
moderateEvent={this.moderateEvent}
Expand Down
8 changes: 3 additions & 5 deletions src/stores/User/user.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class UserStore extends ModuleStore {
super(rootStore)
makeObservable(this)
this._listenToAuthStateChanges()
this.fetchAllVerifiedUsers()
this.loadVerifiedUsers()
}

// when registering a new user create firebase auth profile as well as database user profile
Expand Down Expand Up @@ -285,11 +285,9 @@ export class UserStore extends ModuleStore {
}
}

/**
* Fetches all users that have a `verified: 1` badge
*/
@action
public async fetchAllVerifiedUsers() {
/** Perform a single lookup of all verified users (will update on page reload or on demand) */
public async loadVerifiedUsers() {
const verifiedUsers = await this.db
.collection<any>('aggregations')
.doc('users_verified')
Expand Down

0 comments on commit e57a98f

Please sign in to comment.