Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
images: {
remotePatterns: [
{
protocol: "https",
hostname: "*" // Allow all domains
}
]
remotePatterns: process.env.NODE_ENV === 'production'
? [
{ protocol: "https", hostname: "*" },
// Only specific trusted domains in production
// { protocol: "https", hostname: "yourdomain.com" }
]
: [
{ protocol: "https", hostname: "*" },
{ protocol: "http", hostname: "*" } // Allow all in development
]
}
};

Expand Down
9 changes: 5 additions & 4 deletions src/components/organisms/status/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import LoadingSpinner from "@/components/molecules/common/LoadingSpinner";
import { useTipTapEditor } from "@/hooks/customs/useTipTapEditor";
import Image from "next/image";
import { MastodonCustomEmoji } from "../compose/tools/Emoji";
import { FALLBACK_PREVIEW_IMAGE_URL } from "@/constants/url";

type StatusProps = {
status: StatusType;
Expand Down Expand Up @@ -195,16 +196,16 @@ const Status: React.FC<StatusProps> = ({
>
<div className="relative">
<Image
src={data.account.avatar}
src={data?.account?.avatar || FALLBACK_PREVIEW_IMAGE_URL}
alt="avatar photo"
width={40}
height={40}
className="w-10 aspect-square rounded-full bg-background"
className="w-10 aspect-square object-cover rounded-full bg-background"
/>
{status.reblog && (
<Image
className="w-6 aspect-square rounded-full absolute bottom-0 end-0 translate-2"
src={status?.account?.avatar}
className="w-6 aspect-square object-cover rounded-full absolute bottom-0 end-0 translate-2"
src={status?.account?.avatar || FALLBACK_PREVIEW_IMAGE_URL}
alt="avatar photo"
width={24}
height={24}
Expand Down
Loading