fix: background cache collision

This commit is contained in:
2026-03-18 15:39:24 +07:00 Unverified
parent 3bd8a37bf8
commit 3f79315e00
+24 -6
View File
@@ -130,7 +130,7 @@ export function card(app: App) {
}).then((r) => r.canvas.toBuffer("image/webp")), }).then((r) => r.canvas.toBuffer("image/webp")),
) )
.then((data) => ({ .then((data) => ({
src: "/bg", src: `/bg-${avatar.Element}`,
data, data,
})), })),
] satisfies Promise<{ ] satisfies Promise<{
@@ -142,15 +142,15 @@ export function card(app: App) {
); );
const charLvl = char.propMap?.[4001].val ?? 1; const charLvl = char.propMap?.[4001].val ?? 1;
const charLvlMax = [20, 40, 50, 60, 70, 80, 90, 100][ const promoteMaxLevelMap = [20, 40, 50, 60, 70, 80, 90, 100];
char.propMap?.[1002].val ?? 1 const charLvlMax =
]; promoteMaxLevelMap[char.propMap?.[1002].val ?? 1];
const res = new ImageResponse( const res = new ImageResponse(
<div tw="relative text-[32.25px] text-white rounded-xl overflow-hidden"> <div tw="relative text-[32.25px] text-white rounded-xl overflow-hidden">
<div tw="aspect-[1218/508] h-full"> <div tw="aspect-[1218/508] h-full">
<img <img
src="/bg" src={`/bg-${avatar.Element}`}
alt="background" alt="background"
tw="w-full h-full object-cover" tw="w-full h-full object-cover"
/> />
@@ -183,7 +183,7 @@ export function card(app: App) {
</div> </div>
{/* level */} {/* level */}
<div> <div>
Lv. {charLvl} / Lv. <span tw="px-1">{charLvl}</span> /
<span tw="opacity-60 pl-1">{charLvlMax}</span> <span tw="opacity-60 pl-1">{charLvlMax}</span>
</div> </div>
{/* fren */} {/* fren */}
@@ -318,6 +318,24 @@ export function card(app: App) {
</div> </div>
))} ))}
</div> </div>
<div tw="flex gap-[.5em]">
<div tw="rounded-[.2em] leading-none bg-black/50 px-[.34em] py-[0.175em] flex items-center gap-[.7em] text-[1.03em] text-[wheat]">
<div tw="pt-[.1em]">
R
{Object.values(
weapon.data.affixMap || { _: 0 },
)[0] + 1}
</div>
</div>
<div tw="rounded-[.2em] leading-none bg-black/50 px-[.34em] py-[0.175em] flex items-center gap-[.7em] text-[1.03em]">
<div tw="pt-[.1em]">
Lv. {weapon.data.level} /
<span tw="opacity-60 pl-1">
{promoteMaxLevelMap[weapon.data.promoteLevel]}
</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>