Skip to content

Commit

Permalink
fix: Actually fix phantom profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
KararTY committed Aug 10, 2021
1 parent 16a066c commit a20f3b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/Services/Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class Handler {
}
}

// Yeet them.
filteredProfiles = filteredProfiles.filter(p => p !== null)

if (filteredProfiles.length === 0) {
profile.rolls = []
await profile.save()
Expand All @@ -106,7 +109,7 @@ class Handler {
// Shuffle the array!
this.durstenfeldShuffle(filteredProfiles)

profile.rolls = filteredProfiles.filter(p => p !== null).map((profile: Profile) => profile.id).slice(0, 10)
profile.rolls = filteredProfiles.map((profile: Profile) => profile.id).slice(0, 10)

await profile.save()

Expand Down

0 comments on commit a20f3b0

Please sign in to comment.