Filter for ian's deleted users
This commit is contained in:
parent
3165e42119
commit
5034a43c3c
|
@ -55,14 +55,18 @@ async function handleUserUpdatedReferral(user: User, eventId: string) {
|
|||
.where('category', '==', 'REFERRAL')
|
||||
.get()
|
||||
).docs.map((txn) => txn.ref)
|
||||
const referralTxns = await transaction.getAll(...txns).catch((err) => {
|
||||
console.error('error getting txns:', err)
|
||||
throw err
|
||||
})
|
||||
// If the referring user already has a referral txn due to referring this user, halt
|
||||
if (referralTxns.map((txn) => txn.data()?.description).includes(user.id)) {
|
||||
console.log('found referral txn with the same details, aborting')
|
||||
return
|
||||
if (txns.length > 0) {
|
||||
const referralTxns = await transaction.getAll(...txns).catch((err) => {
|
||||
console.error('error getting txns:', err)
|
||||
throw err
|
||||
})
|
||||
// If the referring user already has a referral txn due to referring this user, halt
|
||||
if (
|
||||
referralTxns.map((txn) => txn.data()?.description).includes(user.id)
|
||||
) {
|
||||
console.log('found referral txn with the same details, aborting')
|
||||
return
|
||||
}
|
||||
}
|
||||
console.log('creating referral txns')
|
||||
const fromId = HOUSE_LIQUIDITY_PROVIDER_ID
|
||||
|
|
|
@ -74,7 +74,9 @@ export function useMembers(group: Group) {
|
|||
}
|
||||
|
||||
export async function listMembers(group: Group) {
|
||||
return await Promise.all(group.memberIds.map(getUser))
|
||||
return (await Promise.all(group.memberIds.map(getUser))).filter(
|
||||
(user) => user
|
||||
)
|
||||
}
|
||||
|
||||
export const useGroupsWithContract = (contractId: string | undefined) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user