mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-31 09:52:24 +00:00
Merge pull request #712 from PR0M3TH3AN/codex/fix-unreliable-video-post-notifications
Handle upload feed refresh failures without false error
This commit is contained in:
1 file changed
+31
-9
@@ -2732,20 +2732,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