mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 21:27:46 +00:00
Compare commits
No commits in common. "a000447b0a8415f7c2998783d4edbc35e753ddb4" and "ed9a48038575684f2efea5ca64a7f94b03e80198" have entirely different histories.
a000447b0a
...
ed9a480385
4 changed files with 7 additions and 11 deletions
|
|
@ -9,7 +9,7 @@ export default async function RandomPage() {
|
||||||
|
|
||||||
const randomIndex = Math.floor(Math.random() * count);
|
const randomIndex = Math.floor(Math.random() * count);
|
||||||
const randomMii = await prisma.mii.findFirst({
|
const randomMii = await prisma.mii.findFirst({
|
||||||
where: { in_queue: false, quarantined: false, needsFixing: null },
|
where: { in_queue: false, quarantined: false, needsFixing: { not: null } },
|
||||||
skip: randomIndex,
|
skip: randomIndex,
|
||||||
take: 1,
|
take: 1,
|
||||||
select: { id: true },
|
select: { id: true },
|
||||||
|
|
|
||||||
|
|
@ -69,13 +69,7 @@ export default function Header() {
|
||||||
data-tooltip="Your Profile"
|
data-tooltip="Your Profile"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={
|
src={$session.user.image.startsWith("/profile") ? `${import.meta.env.VITE_API_URL}${$session.user.image}` : $session.user.image}
|
||||||
$session?.user?.image
|
|
||||||
? $session.user.image.startsWith("/profile")
|
|
||||||
? `${import.meta.env.VITE_API_URL}${$session.user.image}`
|
|
||||||
: $session.user.image
|
|
||||||
: "/guest.png"
|
|
||||||
}
|
|
||||||
onError={(e) => {
|
onError={(e) => {
|
||||||
e.currentTarget.onerror = null; // Prevent infinite loops
|
e.currentTarget.onerror = null; // Prevent infinite loops
|
||||||
e.currentTarget.src = "/guest.png";
|
e.currentTarget.src = "/guest.png";
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ export default function ProfileLayout() {
|
||||||
const joinDate = new Date(user.createdAt).toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
const joinDate = new Date(user.createdAt).toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
||||||
const metaTitle = `${user.name} - TomodachiShare`;
|
const metaTitle = `${user.name} - TomodachiShare`;
|
||||||
const metaDescription = `View ${user.name}'s profile on TomodachiShare. Creator of ${user._count.miis} Miis. Member since ${joinDate}.`;
|
const metaDescription = `View ${user.name}'s profile on TomodachiShare. Creator of ${user._count.miis} Miis. Member since ${joinDate}.`;
|
||||||
const metaImage = user.image ? (user.image.startsWith("/profile") ? `${import.meta.env.VITE_API_URL}${user.image}` : user.image) : "/guest.png";
|
const metaImage = user.image.startsWith("/profile")
|
||||||
|
? `${import.meta.env.VITE_API_URL}${user.image}`
|
||||||
|
: (user.image ?? `${import.meta.env.VITE_API_URL}/guest.png`);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -79,7 +81,7 @@ export default function ProfileLayout() {
|
||||||
{/* Profile picture */}
|
{/* Profile picture */}
|
||||||
<Link to={`/profile/${user.id}`} className="size-28 aspect-square">
|
<Link to={`/profile/${user.id}`} className="size-28 aspect-square">
|
||||||
<img
|
<img
|
||||||
src={user.image ? (user.image.startsWith("/profile") ? `${import.meta.env.VITE_API_URL}${user.image}` : user.image) : "/guest.png"}
|
src={user.image.startsWith("/profile") ? `${import.meta.env.VITE_API_URL}${user.image}` : user.image}
|
||||||
onError={(e) => {
|
onError={(e) => {
|
||||||
e.currentTarget.onerror = null; // Prevent infinite loops
|
e.currentTarget.onerror = null; // Prevent infinite loops
|
||||||
e.currentTarget.src = "/guest.png";
|
e.currentTarget.src = "/guest.png";
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ export default function ReportUserPage() {
|
||||||
|
|
||||||
<div className="bg-orange-100 rounded-xl border-2 border-orange-400 flex p-4 gap-4">
|
<div className="bg-orange-100 rounded-xl border-2 border-orange-400 flex p-4 gap-4">
|
||||||
<img
|
<img
|
||||||
src={user.image ? (user.image.startsWith("/profile") ? `${import.meta.env.VITE_API_URL}${user.image}` : user.image) : "/guest.png"}
|
src={user.image.startsWith("/profile") ? `${import.meta.env.VITE_API_URL}${user.image}` : user.image}
|
||||||
onError={(e) => {
|
onError={(e) => {
|
||||||
e.currentTarget.onerror = null; // Prevent infinite loops
|
e.currentTarget.onerror = null; // Prevent infinite loops
|
||||||
e.currentTarget.src = "/guest.png";
|
e.currentTarget.src = "/guest.png";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue