diff --git a/src/app/(site)/page.tsx b/src/app/(site)/page.tsx index 479bcbac..f69f9cb9 100644 --- a/src/app/(site)/page.tsx +++ b/src/app/(site)/page.tsx @@ -29,57 +29,43 @@ async function getHotelData() { siteSettings.get("cms_logo", ""), ]); - const [ - online, - users, - rooms, - articles, - recentUsers, - recentPhotos, - latestUsers, - ] = await Promise.all([ - cached("online_count", 10_000, () => - db - .select({ total: count() }) - .from(User) - .where(eq(User.online, "1")) - .then((rows) => rows[0]?.total ?? 0), - ).catch(() => 0), - cached("total_users", 300_000, () => - db - .select({ total: count() }) - .from(User) - .then((rows) => rows[0]?.total ?? 0), - ).catch(() => 0), - cached("total_rooms", 300_000, () => - db - .select({ total: count() }) - .from(Rooms) - .then((rows) => rows[0]?.total ?? 0), - ).catch(() => 0), - getNewsList(4), - cached("home_online_users", 15_000, () => - db - .select({ username: User.username, look: User.look }) - .from(User) - .where(eq(User.online, "1")) - .limit(30), - ).catch(() => []), - cached("home_recent_photos", 60_000, () => - db - .select({ id: CameraWeb.id, url: CameraWeb.url }) - .from(CameraWeb) - .orderBy(desc(CameraWeb.timestamp)) - .limit(4), - ).catch(() => []), - cached("home_latest_users", 60_000, () => - db - .select({ username: User.username, look: User.look }) - .from(User) - .orderBy(desc(User.accountCreated)) - .limit(8), - ).catch(() => []), - ]); + const [online, users, rooms, articles, recentUsers, recentPhotos] = + await Promise.all([ + cached("online_count", 10_000, () => + db + .select({ total: count() }) + .from(User) + .where(eq(User.online, "1")) + .then((rows) => rows[0]?.total ?? 0), + ).catch(() => 0), + cached("total_users", 300_000, () => + db + .select({ total: count() }) + .from(User) + .then((rows) => rows[0]?.total ?? 0), + ).catch(() => 0), + cached("total_rooms", 300_000, () => + db + .select({ total: count() }) + .from(Rooms) + .then((rows) => rows[0]?.total ?? 0), + ).catch(() => 0), + getNewsList(4), + cached("home_online_users", 15_000, () => + db + .select({ username: User.username, look: User.look }) + .from(User) + .where(eq(User.online, "1")) + .limit(12), + ).catch(() => []), + cached("home_recent_photos", 60_000, () => + db + .select({ id: CameraWeb.id, url: CameraWeb.url }) + .from(CameraWeb) + .orderBy(desc(CameraWeb.timestamp)) + .limit(4), + ).catch(() => []), + ]); return { hotelName, @@ -89,7 +75,6 @@ async function getHotelData() { articles, recentUsers, recentPhotos, - latestUsers, logo, }; } @@ -108,7 +93,6 @@ export default async function Home() { articles, recentUsers, recentPhotos, - latestUsers, logo, } = await getHotelData(); @@ -303,13 +287,8 @@ export default async function Home() { {/* ── Stats ── */} -
+
{[ - { - value: online, - label: tp("statsOnline"), - icon: "/assets/images/icons/online-friends.png", - }, { value: users, label: tp("statsCitizens"), @@ -365,7 +344,7 @@ export default async function Home() { {/* ── Login + News ── */}
- {/* Left: Login & Register */} + {/* Left: Login & Online users */} - - - Register - - - {tp("register")} - - - - {latestUsers.length > 0 && ( + {recentUsers.length > 0 && (
- {latestUsers.map((u) => ( + {recentUsers.map((u) => (
{u.username} @@ -501,91 +464,6 @@ export default async function Home() {
- {/* ── Online users ── */} - {recentUsers.length > 0 && ( - - -
- {recentUsers.slice(0, 12).map((u) => ( -
- - - {u.username} - -
- ))} -
-
-
- )} - - {/* ── Bottom CTA ── */} - -
-

- {tp("joinNow", { hotelName })} -

-

- {tp("welcomeBody")} -

- - - {tp("register")} - -
-
- {/* ── Recent photos ── */} {recentPhotos.length > 0 && ( diff --git a/src/components/shared/public-avatar-contract.test.ts b/src/components/shared/public-avatar-contract.test.ts index de5681e8..c3367bae 100644 --- a/src/components/shared/public-avatar-contract.test.ts +++ b/src/components/shared/public-avatar-contract.test.ts @@ -10,7 +10,7 @@ const compactCallSites = new Map([ ["src/app/(site)/login/page.tsx", 2], ["src/app/(site)/me/page.tsx", 1], ["src/app/(site)/messages/page.tsx", 2], - ["src/app/(site)/page.tsx", 2], + ["src/app/(site)/page.tsx", 1], ["src/app/(site)/radio/leaderboard/page.tsx", 1], ["src/app/(site)/radio/shouts/page.tsx", 1], ["src/app/(site)/rankings/page.tsx", 1],