From 1ff0dc8d550f6405074de801e732658bebbbdf69 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 20 Oct 2025 12:47:25 -0400 Subject: [PATCH] Improve upload success messaging when feed refresh fails --- js/app.js | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/js/app.js b/js/app.js index 14514290..5ca0f88a 100644 --- a/js/app.js +++ b/js/app.js @@ -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; } /**