mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-02 10:52:27 +00:00
fix(upload): improve error feedback in UploadModal
- Keep progress bar visible on upload failure - Style error status text with `text-critical` - Set generated link inputs to "Upload Failed" to clearly indicate failure - Reset error state on retry
This commit is contained in:
1 parent
e25b759d3b
commit
cd94900f02
1 file changed
+16
-1
@@ -479,6 +479,12 @@ export class UploadModal {
|
||||
// Start new session
|
||||
const currentUploadId = ++this.videoUploadId;
|
||||
|
||||
// Reset UI classes
|
||||
if (this.statusText.uploadMain) {
|
||||
this.statusText.uploadMain.classList.remove("text-critical");
|
||||
this.statusText.uploadMain.classList.add("text-text");
|
||||
}
|
||||
|
||||
// Reset Video State
|
||||
this.videoUploadState = {
|
||||
status: 'uploading',
|
||||
@@ -630,9 +636,18 @@ export class UploadModal {
|
||||
userLogger.error("Video upload sequence failed:", err);
|
||||
this.videoUploadState.status = 'error';
|
||||
this.updateVideoProgress(null, "Upload failed.");
|
||||
|
||||
if (this.statusText.uploadMain) {
|
||||
this.statusText.uploadMain.classList.remove("text-text");
|
||||
this.statusText.uploadMain.classList.add("text-critical");
|
||||
}
|
||||
|
||||
if (this.results.videoUrl) this.results.videoUrl.value = "Upload Failed";
|
||||
if (this.results.magnet) this.results.magnet.value = "Upload Failed";
|
||||
if (this.results.torrentUrl) this.results.torrentUrl.value = "Upload Failed";
|
||||
|
||||
alert(`Upload failed: ${err.message}`);
|
||||
|
||||
this.sourceSections.progress.classList.add("hidden");
|
||||
this.inputs.file.value = ""; // Reset
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user