fix: 런처 삭제 시 게임 시작 불가 이슈 해결
All checks were successful
Client CI/CD / deploy (push) Successful in 22s

blur 이벤트 기반 런처 감지 로직을 제거하고 런처 다운로드 버튼을
항상 노출하도록 변경. 레지스트리만 남아있고 런처 파일이 없는 경우에도
사용자가 직접 런처를 재다운로드할 수 있도록 함.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 13:49:05 +09:00
parent f4196f5918
commit f85e261366
2 changed files with 36 additions and 20 deletions

View File

@@ -7,7 +7,6 @@ import './DownloadSection.css';
export default function DownloadSection() {
const [info, setInfo] = useState(null);
const [ready, setReady] = useState(false);
const [launching, setLaunching] = useState(false);
const { user } = useAuth();
const navigate = useNavigate();
@@ -23,24 +22,16 @@ export default function DownloadSection() {
return;
}
setLaunching(true);
let launched = false;
const onBlur = () => { launched = true; };
window.addEventListener('blur', onBlur);
window.location.href = 'a301://launch?token=' + user.token;
};
setTimeout(() => {
window.removeEventListener('blur', onBlur);
setLaunching(false);
if (!launched && info?.launcherUrl) {
// 런처 미설치 → launcher.exe 다운로드
const a = document.createElement('a');
a.href = info.launcherUrl;
a.download = 'launcher.exe';
a.click();
}
}, 2000);
const handleDownloadLauncher = () => {
if (info?.launcherUrl) {
const a = document.createElement('a');
a.href = info.launcherUrl;
a.download = 'launcher.exe';
a.click();
}
};
if (!ready) return null;
@@ -54,11 +45,16 @@ export default function DownloadSection() {
<p className="download-meta">
{info.version} &middot; {info.fileSize}
</p>
<button onClick={handlePlay} className="btn-play" disabled={launching}>
{launching ? '실행 중...' : '게임 시작'}
<button onClick={handlePlay} className="btn-play">
게임 시작
</button>
{info?.launcherUrl && (
<button onClick={handleDownloadLauncher} className="btn-launcher-download">
런처 다운로드
</button>
)}
<p className="launch-hint">
런처 미설치 자동으로 다운로드됩니다. 설치 다시 클릭하세요.
처음이거나 게임이 실행되지 않으면 런처를 다운로드해주세요.
</p>
</>
) : (