summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-06-15 15:55:03 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-06-15 15:55:03 +0200
commit9e14218bc6d56decfc451000e31eb6849bb16592 (patch)
tree8998721ceee4512734489d50b76563b0100d4540
parentFix pins not refreshing after being loaded (diff)
downloadnheko-9e14218bc6d56decfc451000e31eb6849bb16592.tar.xz
Fix failed uploads not removing uploads
fixes #1098
-rw-r--r--src/timeline/InputBar.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 4a3605bb..97fe5cf4 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -1081,6 +1081,11 @@ InputBar::startUpload(std::unique_ptr<QIODevice> dev, const QString &orgPath, co
     auto upload =
       UploadHandle(new MediaUpload(std::move(dev), format, orgPath, room->isEncrypted(), this));
     connect(upload.get(), &MediaUpload::uploadComplete, this, &InputBar::finalizeUpload);
+    // TODO(Nico): Show a retry option
+    connect(upload.get(), &MediaUpload::uploadFailed, this, [this](MediaUpload *up) {
+        ChatPage::instance()->showNotification(tr("Upload of '%1' failed").arg(up->filename()));
+        removeRunUpload(up);
+    });
 
     unconfirmedUploads.push_back(std::move(upload));