Improve upload success messaging when feed refresh fails

This commit is contained in:
thePR0M3TH3AN committed 2025-10-20 12:47:25 -04:00
1 parent 59a29b1313
commit 1ff0dc8d55
1 file changed
+31 -9
+31 -9
View File
@@ -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;
}
/**