diff --git a/src/routes/pubnix/+page.server.ts b/src/routes/pubnix/+page.server.ts index f48f33c..1c33249 100644 --- a/src/routes/pubnix/+page.server.ts +++ b/src/routes/pubnix/+page.server.ts @@ -9,6 +9,7 @@ export const load = (async () => { return { users: get(pubnixUsers), + onlineUserCount: get(pubnixUsers).length, ...meta } }) satisfies PageServerLoad; diff --git a/src/routes/pubnix/+page.svelte b/src/routes/pubnix/+page.svelte index 6b55f38..516dc41 100644 --- a/src/routes/pubnix/+page.svelte +++ b/src/routes/pubnix/+page.svelte @@ -5,6 +5,10 @@ import User, { type UserType } from "./User.svelte"; const isOnline = (user: UserType) => user.online; + + const onlineUserCount = data.users.users.filter(isOnline).length; + + const userCount = data.users.users.length;
There are {onlineUserCount} users online out of {userCount} users.
There are {userCount} users on the pubnix.