Improvements: remove dead config, fix ESM, add URL validation, unify types, add missing logging
- Remove .prettierrc (dead config, Biome replaces Prettier) - Rename lighthouserc.json to lighthouserc.cjs with module.exports for ESM compat - Add logger.warn to empty catch blocks in auth, register, site-settings, prisma-cache, redis, security, rate-limit - Unify ActionResult type: action-helper.ts uses 'ok' consistent with safe-action-shared.ts - Add noUnusedLocals + noUnusedParameters to tsconfig + fix 25 pre-existing unused vars - Replace barrel export src/types/index.ts with direct @/types/common imports - Make trustHost conditional (development only) in auth.ts - Add pre-flight URL validation to update-Nitrov3.sh to catch image.library.url misconfigurations - Improve NITRO_IMAGE_LIBRARY_URL content validation in pre-flight & post-compute checks
This commit is contained in:
1 parent
b922f6d49f
commit
17847545dd
292 files changed
+69195
-67915
No files matched your search
@@ -2,14 +2,14 @@ import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import type { Session } from "next-auth";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { RoomQuickEntry } from "@/components/room-quick-entry";
|
||||
import { signOut } from "@/lib/auth";
|
||||
import { avatarImageUrl } from "@/lib/format";
|
||||
import { cached } from "@/lib/cache";
|
||||
import { avatarImageUrl } from "@/lib/format";
|
||||
import { resolveHotelName } from "@/lib/hotel-name";
|
||||
import { canAccess, getApiAdminContext, PERMS } from "@/lib/permissions";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { resolveHotelName } from "@/lib/hotel-name";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
import { RoomQuickEntry } from "@/components/room-quick-entry";
|
||||
|
||||
function Currency({
|
||||
icon,
|
||||
@@ -65,8 +65,7 @@ export async function TopHeader({ session }: { session: Session | null }) {
|
||||
if (c.type === 0) duckets = c.amount;
|
||||
if (c.type === 5) diamonds = c.amount;
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
} catch {}
|
||||
|
||||
const imager =
|
||||
(await siteSettings.get(
|
||||
@@ -115,8 +114,7 @@ export async function TopHeader({ session }: { session: Session | null }) {
|
||||
prisma.messengerOffline.count({ where: { userId: id } }),
|
||||
prisma.messengerFriendrequests.count({ where: { userToId: id } }),
|
||||
]);
|
||||
} catch {
|
||||
}
|
||||
} catch {}
|
||||
|
||||
const friendRequests = await prisma.messengerFriendrequests
|
||||
.findMany({
|
||||
@@ -161,8 +159,10 @@ export async function TopHeader({ session }: { session: Session | null }) {
|
||||
style={{
|
||||
background: "var(--color-primary)",
|
||||
color: "var(--color-primary-foreground)",
|
||||
borderColor: "color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
||||
boxShadow: "0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
||||
boxShadow:
|
||||
"0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
@@ -200,7 +200,8 @@ export async function TopHeader({ session }: { session: Session | null }) {
|
||||
style={{
|
||||
background: "var(--color-background)",
|
||||
color: "var(--color-text-readable)",
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 25%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 25%, transparent)",
|
||||
}}
|
||||
/>
|
||||
</form>
|
||||
@@ -348,7 +349,10 @@ export async function TopHeader({ session }: { session: Session | null }) {
|
||||
}}
|
||||
/>
|
||||
<div className="px-3 py-1.5">
|
||||
<p className="text-xs font-bold mb-1" style={{ color: "var(--color-text-muted)" }}>
|
||||
<p
|
||||
className="text-xs font-bold mb-1"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
Friend requests ({pendingFriendRequests})
|
||||
</p>
|
||||
{friendRequestUsers.slice(0, 3).map((u) => (
|
||||
@@ -372,7 +376,10 @@ export async function TopHeader({ session }: { session: Session | null }) {
|
||||
</Link>
|
||||
))}
|
||||
{friendRequestUsers.length > 3 && (
|
||||
<p className="text-xs mt-1 opacity-60" style={{ color: textColor }}>
|
||||
<p
|
||||
className="text-xs mt-1 opacity-60"
|
||||
style={{ color: textColor }}
|
||||
>
|
||||
+{friendRequestUsers.length - 3} more
|
||||
</p>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user