fix: 다운로드 정보 없을 때 준비중 메시지 표시
All checks were successful
Client CI/CD / deploy (push) Successful in 12s

404 응답 시 컴포넌트가 사라지는 대신 안내 문구 노출

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 14:39:26 +09:00
parent 2f56dfb519
commit 9fa665c9c0
2 changed files with 23 additions and 8 deletions

View File

@@ -38,3 +38,9 @@
opacity: 0.9; opacity: 0.9;
transform: translateY(-1px); transform: translateY(-1px);
} }
.download-preparing {
font-size: 0.9rem;
color: rgba(255, 255, 255, 0.4);
margin: 0;
}

View File

@@ -6,11 +6,14 @@ import './DownloadSection.css';
export default function DownloadSection() { export default function DownloadSection() {
const [info, setInfo] = useState(null); const [info, setInfo] = useState(null);
const [ready, setReady] = useState(false);
const { user } = useAuth(); const { user } = useAuth();
const navigate = useNavigate(); const navigate = useNavigate();
useEffect(() => { useEffect(() => {
getDownloadInfo().then(setInfo); getDownloadInfo()
.then((data) => { setInfo(data); setReady(true); })
.catch(() => setReady(true));
}, []); }, []);
const handleDownload = (e) => { const handleDownload = (e) => {
@@ -20,18 +23,24 @@ export default function DownloadSection() {
} }
}; };
if (!info) return null; if (!ready) return null;
return ( return (
<section className="download-section"> <section className="download-section">
<div className="download-content"> <div className="download-content">
<h2 className="download-title">게임 런처 다운로드</h2> <h2 className="download-title">게임 런처 다운로드</h2>
{info ? (
<>
<p className="download-meta"> <p className="download-meta">
{info.fileName} &middot; {info.fileSize} &middot; {info.version} {info.fileName} &middot; {info.fileSize} &middot; {info.version}
</p> </p>
<a href={info.url} download onClick={handleDownload} className="btn-download"> <a href={info.url} download onClick={handleDownload} className="btn-download">
{user ? '다운로드' : '로그인 후 다운로드'} {user ? '다운로드' : '로그인 후 다운로드'}
</a> </a>
</>
) : (
<p className="download-preparing">런처 준비 중입니다. 잠시 다시 확인해주세요.</p>
)}
</div> </div>
</section> </section>
); );