fix: remove duplicate DOMContentLoaded event listener in ui.js causing parallel duplicate file uploads and daemon startup race conditions

This commit is contained in:
joshpatra committed 2026-07-07 20:08:24 -04:00
1 parent 58daeda4da
commit 940679ecaf
1 file changed
-18
-18
View File
@@ -1362,24 +1362,6 @@ function updateAmIndicator(id, active) {
}
}
// Upload APK
document.addEventListener("DOMContentLoaded", () => {
const apkInput = document.getElementById("am-apk-input");
if (apkInput) {
apkInput.addEventListener("change", (e) => {
if (e.target.files.length > 0) {
uploadAppleMusicApk(e.target.files[0]);
}
});
}
// Start polling status
setInterval(pollAppleMusicStatus, 3500);
// Also poll once immediately after tab load or startup
setTimeout(pollAppleMusicStatus, 1000);
});
async function uploadAppleMusicApk(file) {
isAmUploading = true;
const progressContainer = document.getElementById("am-upload-progress-container");