installer-rp: add resume-on-retry and discard-on-quit for failed installs
On install failure the temp folder is now preserved instead of wiped, so already-downloaded songs/images are skipped on the next attempt. The error screen offers 재시도 (resume from the failed item) and 처음으로 (discard the partial download and restart). Closing the program without retrying still wipes the partial download via window-all-closed, and an explicit cancel also clears it. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
@@ -485,10 +485,43 @@ function renderStep2() {
|
||||
}).catch(function (err) {
|
||||
state.installing = false
|
||||
if (stopProgress) stopProgress()
|
||||
if (!cancelInitiated) {
|
||||
alert(tt('common.installFailed', { message: (err && err.message) || err }))
|
||||
if (cancelInitiated) {
|
||||
// 취소: backend 가 임시 파일을 이미 정리했음. 조용히 처음 단계로.
|
||||
renderStep1()
|
||||
return
|
||||
}
|
||||
renderStep1()
|
||||
// 그 외 오류: 받아둔 음악·사진은 보존되어 있으므로 '재시도' 로 이어받을 수 있다.
|
||||
showInstallError((err && err.message) || String(err))
|
||||
})
|
||||
}
|
||||
|
||||
// 설치 실패 화면: 이어받기('재시도')와 처음으로('처음으로') 선택지를 제공한다.
|
||||
// 재시도 시 이미 받아둔 곡·사진은 건너뛰고 실패한 지점부터 이어서 설치한다.
|
||||
function showInstallError(message) {
|
||||
setActiveStep(2)
|
||||
clearPage()
|
||||
var section = document.createElement('section')
|
||||
section.className = 'page'
|
||||
section.innerHTML =
|
||||
'<h2>' + escapeHtml(tt('step2.heading')) + '</h2>' +
|
||||
'<p class="formMessage error">' + escapeHtml(tt('install.errorMessage', { message: message })) + '</p>' +
|
||||
'<p class="formMessage">' + escapeHtml(tt('install.resumeHint')) + '</p>' +
|
||||
'<div class="actionRow">' +
|
||||
' <button class="secondaryBtn" id="startOver">' + escapeHtml(tt('install.startOver')) + '</button>' +
|
||||
' <button class="primaryBtn" id="retry">' + escapeHtml(tt('install.retry')) + '</button>' +
|
||||
'</div>'
|
||||
pageHost.appendChild(section)
|
||||
section.querySelector('#retry').addEventListener('click', function () {
|
||||
// 같은 음악퀴즈로 설치를 다시 시작. backend 가 받아둔 산출물을 건너뛴다.
|
||||
renderStep2()
|
||||
})
|
||||
section.querySelector('#startOver').addEventListener('click', function () {
|
||||
// 이어받지 않고 처음으로: 받아둔 임시 파일을 정리한 뒤 1단계로.
|
||||
api.discardInstall().then(function () {
|
||||
renderStep1()
|
||||
}).catch(function () {
|
||||
renderStep1()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user