mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 16:32:28 +00:00
Improve upload success messaging when feed refresh fails
This commit is contained in:
1 parent
59a29b1313
commit
1ff0dc8d55
1 file changed
+31
-9
@@ -2712,20 +2712,42 @@ class Application {
|
||||
|
||||
try {
|
||||
await this.nostrService.publishVideoNote(publishPayload, this.pubkey);
|
||||
if (typeof onSuccess === "function") {
|
||||
await onSuccess();
|
||||
}
|
||||
if (suppressModalClose !== true && this.uploadModal) {
|
||||
this.uploadModal.close();
|
||||
}
|
||||
await this.loadVideos();
|
||||
this.showSuccess("Video shared successfully!");
|
||||
return true;
|
||||
} catch (err) {
|
||||
devLogger.error("Failed to publish video:", err);
|
||||
this.showError("Failed to share video. Please try again later.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof onSuccess === "function") {
|
||||
await onSuccess();
|
||||
}
|
||||
|
||||
if (suppressModalClose !== true && this.uploadModal) {
|
||||
this.uploadModal.close();
|
||||
}
|
||||
|
||||
let loadVideosError = null;
|
||||
|
||||
try {
|
||||
await this.loadVideos();
|
||||
} catch (error) {
|
||||
loadVideosError = error;
|
||||
devLogger.error(
|
||||
"[Application] Failed to refresh videos after publishing:",
|
||||
error
|
||||
);
|
||||
}
|
||||
|
||||
this.showSuccess("Video shared successfully!");
|
||||
|
||||
if (loadVideosError) {
|
||||
this.showStatus(
|
||||
"Video shared, but the feed may be out of date. Refresh the page to see the latest posts.",
|
||||
{ autoHideMs: 8000 }
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user