Fix failed uploads not removing uploads

fixes #1098
This commit is contained in:
Nicolas Werner 2022-06-15 15:55:03 +02:00
parent 3eafd4396e
commit 9e14218bc6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -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));