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
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_CORE_FRONT_BASE_URL="http://localhost:5173"
VITE_CORE_API_BASE_URL="http://localhost:8090"
VITE_CORE_API_BASE_URL="http://localhost:8090"
REACT_APP_API_URL=http://localhost:8090
Binary file removed public/pets/EGG_0.png
Binary file not shown.
Binary file removed public/pets/EGG_1.png
Binary file not shown.
Binary file modified public/pets/EGG_1_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/pets/EGG_2_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/pets/GROWN_0.png
Binary file not shown.
Binary file removed public/pets/GROWN_1.png
Binary file not shown.
Binary file modified public/pets/GROWN_1_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/pets/GROWN_2_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/pets/HATCH_0.png
Binary file not shown.
Binary file removed public/pets/HATCH_1.png
Binary file not shown.
Binary file modified public/pets/HATCH_1_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/pets/HATCH_2_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 16 additions & 11 deletions src/components/ChatRoomList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ChatService from '../services/ChatService';
import ChatRoom from './ChatRoom';
import PasswordModal from './PasswordModal';
import './ChatStyles.css';
import { API_BACKEND_URL } from '../config';
import { Home } from 'lucide-react'; // Import Home icon from lucide-react

const ChatRoomList = () => {
Expand Down Expand Up @@ -263,13 +262,16 @@ const ChatRoomList = () => {
const isRoomsEmpty = rooms.length === 0;

const getImageUrl = (imageUrl) => {
if (!imageUrl) return null;
console.log('Original imageUrl:', imageUrl); // 디버깅용
// API_BACKEND_URL이 이미 슬래시로 끝나지 않는지 확인
const baseUrl = API_BACKEND_URL.endsWith('/') ? API_BACKEND_URL.slice(0, -1) : API_BACKEND_URL;
const fullUrl = `${baseUrl}${imageUrl}`;
console.log('Full imageUrl:', fullUrl); // 디버깅용
return fullUrl;
if (!imageUrl) return '/default-room.png';
try {
// 이미 완전한 S3 URL인 경우 그대로 반환
if (imageUrl.includes('s3.ap-northeast-2.amazonaws.com')) {
return imageUrl;
}
return '/default-room.png';
} catch {
return '/default-room.png';
}
};

return (
Expand Down Expand Up @@ -345,10 +347,13 @@ const ChatRoomList = () => {
src={getImageUrl(room.imageUrl)}
alt={room.title}
className="room-image"
loading="lazy"
onError={(e) => {
console.log('Image load failed:', room.imageUrl);
e.target.onerror = null;
e.target.src = '/default-room.png';
if (!e.target.getAttribute('data-error-handled')) {
console.error('Image load failed:', room.imageUrl);
e.target.setAttribute('data-error-handled', 'true');
e.target.src = '/default-room.png';
}
}}
/>
) : (
Expand Down
Loading