fix: 다운로드 정보 없을 때 준비중 메시지 표시
All checks were successful
Client CI/CD / deploy (push) Successful in 12s
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:
@@ -38,3 +38,9 @@
|
||||
opacity: 0.9;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.download-preparing {
|
||||
font-size: 0.9rem;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,14 @@ import './DownloadSection.css';
|
||||
|
||||
export default function DownloadSection() {
|
||||
const [info, setInfo] = useState(null);
|
||||
const [ready, setReady] = useState(false);
|
||||
const { user } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
getDownloadInfo().then(setInfo);
|
||||
getDownloadInfo()
|
||||
.then((data) => { setInfo(data); setReady(true); })
|
||||
.catch(() => setReady(true));
|
||||
}, []);
|
||||
|
||||
const handleDownload = (e) => {
|
||||
@@ -20,18 +23,24 @@ export default function DownloadSection() {
|
||||
}
|
||||
};
|
||||
|
||||
if (!info) return null;
|
||||
if (!ready) return null;
|
||||
|
||||
return (
|
||||
<section className="download-section">
|
||||
<div className="download-content">
|
||||
<h2 className="download-title">게임 런처 다운로드</h2>
|
||||
{info ? (
|
||||
<>
|
||||
<p className="download-meta">
|
||||
{info.fileName} · {info.fileSize} · {info.version}
|
||||
</p>
|
||||
<a href={info.url} download onClick={handleDownload} className="btn-download">
|
||||
{user ? '다운로드' : '로그인 후 다운로드'}
|
||||
</a>
|
||||
</>
|
||||
) : (
|
||||
<p className="download-preparing">런처 준비 중입니다. 잠시 후 다시 확인해주세요.</p>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user