fix: resolve TypeScript and lint issues
- Fix proxy routes to use resolveImagerBase instead of removed resolveUpstreamBase - Fix avatarImageUrl type signature to use AvatarOptions - Run biome formatter
This commit is contained in:
1 parent
fc7e6ca248
commit
7a2c0fd4d4
19 files changed
+86
-164
No files matched your search
@@ -19,7 +19,6 @@ import {
|
||||
} from "@/lib/db";
|
||||
import { avatarImageUrl } from "@/lib/format";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
|
||||
type SearchParams = Promise<{
|
||||
accepted?: string;
|
||||
@@ -65,10 +64,9 @@ export default async function MessagesPage({
|
||||
sendedOn: number;
|
||||
}[] = [];
|
||||
let friendships: { userOneId: number; userTwoId: number }[] = [];
|
||||
let imagerBase = "https://www.habbo.com/habbo-imaging/avatarimage";
|
||||
|
||||
try {
|
||||
const [reqRows, msgRows, friendRows, base] = await Promise.all([
|
||||
const [reqRows, msgRows, friendRows] = await Promise.all([
|
||||
db
|
||||
.select({
|
||||
id: MessengerFriendrequests.id,
|
||||
@@ -101,15 +99,10 @@ export default async function MessagesPage({
|
||||
eq(MessengerFriendships.userTwoId, userId),
|
||||
),
|
||||
),
|
||||
siteSettings.get(
|
||||
"habbo_imaging_url",
|
||||
"https://www.habbo.com/habbo-imaging/avatarimage",
|
||||
),
|
||||
]);
|
||||
requests = reqRows;
|
||||
messages = msgRows;
|
||||
friendships = friendRows;
|
||||
if (base) imagerBase = base;
|
||||
} catch {
|
||||
requests = [];
|
||||
messages = [];
|
||||
@@ -277,7 +270,7 @@ export default async function MessagesPage({
|
||||
<div className="grid" style={{ padding: "1rem", gap: "0.75rem" }}>
|
||||
{requests.map((req) => {
|
||||
const from = userById.get(req.userFromId);
|
||||
const avatar = avatarImageUrl(imagerBase, from?.look ?? "", {
|
||||
const avatar = avatarImageUrl(from?.look ?? "", {
|
||||
size: "s",
|
||||
headOnly: true,
|
||||
});
|
||||
@@ -367,7 +360,7 @@ export default async function MessagesPage({
|
||||
<div className="grid" style={{ padding: "1rem", gap: "0.75rem" }}>
|
||||
{messages.map((msg) => {
|
||||
const from = userById.get(msg.userFromId);
|
||||
const avatar = avatarImageUrl(imagerBase, from?.look ?? "", {
|
||||
const avatar = avatarImageUrl(from?.look ?? "", {
|
||||
size: "s",
|
||||
headOnly: true,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user