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

@@ -44,6 +44,26 @@
transform: none; transform: none;
} }
.btn-launcher-download {
display: inline-block;
margin-left: 12px;
padding: 18px 32px;
background: transparent;
color: #BACDB0;
border: 1px solid rgba(186, 205, 176, 0.4);
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.2s, transform 0.15s;
letter-spacing: 0.03em;
}
.btn-launcher-download:hover {
background: rgba(186, 205, 176, 0.1);
transform: translateY(-1px);
}
.launch-hint { .launch-hint {
font-size: 0.78rem; font-size: 0.78rem;
color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.3);

View File

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