From c5a631d5468e70c273ff93311b08f082cd10f615 Mon Sep 17 00:00:00 2001 From: fmodf Date: Sat, 13 Jul 2024 16:41:56 +0200 Subject: [PATCH] wip --- .../AppCore/Middlewares/DatabaseMiddleware.swift | 2 +- .../Resources/Strings/Localizable.strings | 2 +- .../ConversationMessageContainer.swift | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ConversationsClassic/AppCore/Middlewares/DatabaseMiddleware.swift b/ConversationsClassic/AppCore/Middlewares/DatabaseMiddleware.swift index f2a7beb..bf55b06 100644 --- a/ConversationsClassic/AppCore/Middlewares/DatabaseMiddleware.swift +++ b/ConversationsClassic/AppCore/Middlewares/DatabaseMiddleware.swift @@ -275,7 +275,7 @@ final class DatabaseMiddleware { _ = try database._db.write { db in try Message .filter(Column("id") == id) - .updateAll(db, Column("attachmentDownloadFailed").set(to: false)) + .updateAll(db, Column("attachmentDownloadFailed").set(to: true)) } promise(.success(.empty)) } catch { diff --git a/ConversationsClassic/Resources/Strings/Localizable.strings b/ConversationsClassic/Resources/Strings/Localizable.strings index eb99b2d..a5fefd7 100644 --- a/ConversationsClassic/Resources/Strings/Localizable.strings +++ b/ConversationsClassic/Resources/Strings/Localizable.strings @@ -68,4 +68,4 @@ "Attachment.Send.media" = "Send media"; "Attachment.Send.location" = "Send location"; "Attachment.Send.contact" = "Send contact"; - +"Attachment.Downloading.retry" = "Retry"; diff --git a/ConversationsClassic/View/Screens/Conversation/ConversationMessageContainer.swift b/ConversationsClassic/View/Screens/Conversation/ConversationMessageContainer.swift index 4dec962..68eb56a 100644 --- a/ConversationsClassic/View/Screens/Conversation/ConversationMessageContainer.swift +++ b/ConversationsClassic/View/Screens/Conversation/ConversationMessageContainer.swift @@ -123,11 +123,19 @@ private struct AttachmentView: View { .frame(width: Const.attachmentPreviewSize, height: Const.attachmentPreviewSize) .overlay { ZStack { - Image(systemName: "exclamationmark.triangle") - .font(.body1) - .foregroundColor(.Rainbow.red500) + VStack { + Text(L10n.Attachment.Downloading.retry) + .font(.body3) + .foregroundColor(.Rainbow.red500) + Image(systemName: "exclamationmark.arrow.triangle.2.circlepath") + .font(.body1) + .foregroundColor(.Rainbow.red500) + } } } + .onTapGesture { + // TODO: Retry download + } } private func progressImageName(_ type: MessageAttachmentType) -> String {