Exclude SalemCenter from leaderboards

This commit is contained in:
James Grugett 2022-08-02 18:11:02 -07:00
parent f61c2c2cc0
commit 0f28fe3302
2 changed files with 10 additions and 3 deletions

View File

@ -210,14 +210,20 @@ export async function listAllUsers() {
return docs.map((doc) => doc.data())
}
export function getTopTraders(period: Period) {
export async function getTopTraders(period: Period) {
const topTraders = query(
users,
orderBy('profitCached.' + period, 'desc'),
limit(20)
limit(21)
)
return getValues<User>(topTraders)
const topUsers = await getValues<User>(topTraders)
return topUsers
.filter(
(user) =>
user.username !== 'SalemCenter' && user.username !== 'RichardHanania'
)
.slice(0, 20)
}
export function getTopCreators(period: Period) {

View File

@ -73,6 +73,7 @@ export default function Leaderboards(_props: {
const LeaderboardWithPeriod = (period: Period) => {
const { topTraders } = props[period]
return (
<>
<Col className="mx-4 items-center gap-10 lg:flex-row">