This commit is contained in:
fmodf 2024-07-13 16:41:56 +02:00
parent ae7a13e92b
commit c5a631d546
3 changed files with 13 additions and 5 deletions

View file

@ -275,7 +275,7 @@ final class DatabaseMiddleware {
_ = try database._db.write { db in _ = try database._db.write { db in
try Message try Message
.filter(Column("id") == id) .filter(Column("id") == id)
.updateAll(db, Column("attachmentDownloadFailed").set(to: false)) .updateAll(db, Column("attachmentDownloadFailed").set(to: true))
} }
promise(.success(.empty)) promise(.success(.empty))
} catch { } catch {

View file

@ -68,4 +68,4 @@
"Attachment.Send.media" = "Send media"; "Attachment.Send.media" = "Send media";
"Attachment.Send.location" = "Send location"; "Attachment.Send.location" = "Send location";
"Attachment.Send.contact" = "Send contact"; "Attachment.Send.contact" = "Send contact";
"Attachment.Downloading.retry" = "Retry";

View file

@ -123,12 +123,20 @@ private struct AttachmentView: View {
.frame(width: Const.attachmentPreviewSize, height: Const.attachmentPreviewSize) .frame(width: Const.attachmentPreviewSize, height: Const.attachmentPreviewSize)
.overlay { .overlay {
ZStack { ZStack {
Image(systemName: "exclamationmark.triangle") VStack {
Text(L10n.Attachment.Downloading.retry)
.font(.body3)
.foregroundColor(.Rainbow.red500)
Image(systemName: "exclamationmark.arrow.triangle.2.circlepath")
.font(.body1) .font(.body1)
.foregroundColor(.Rainbow.red500) .foregroundColor(.Rainbow.red500)
} }
} }
} }
.onTapGesture {
// TODO: Retry download
}
}
private func progressImageName(_ type: MessageAttachmentType) -> String { private func progressImageName(_ type: MessageAttachmentType) -> String {
switch type { switch type {