fix: 런처 삭제 시 게임 시작 불가 이슈 해결
All checks were successful
Client CI/CD / deploy (push) Successful in 22s
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:
@@ -44,6 +44,26 @@
|
||||
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 {
|
||||
font-size: 0.78rem;
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
|
||||
@@ -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 handleDownloadLauncher = () => {
|
||||
if (info?.launcherUrl) {
|
||||
const a = document.createElement('a');
|
||||
a.href = info.launcherUrl;
|
||||
a.download = 'launcher.exe';
|
||||
a.click();
|
||||
}
|
||||
}, 2000);
|
||||
};
|
||||
|
||||
if (!ready) return null;
|
||||
@@ -54,11 +45,16 @@ export default function DownloadSection() {
|
||||
<p className="download-meta">
|
||||
{info.version} · {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>
|
||||
</>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user