Skip to content

Commit

Permalink
Merge pull request #1003 from Infomaniak/fix-notification-tap-unknown…
Browse files Browse the repository at this point in the history
…-message

feat: Display error when message not found on body load
  • Loading branch information
Ambrdctr committed Oct 2, 2023
2 parents a0ebed3 + fa470ce commit 85e85f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Mail/Views/Thread/MessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@

import CocoaLumberjackSwift
import InfomaniakCore
import InfomaniakDI
import MailCore
import MailResources
import RealmSwift
import SwiftUI

/// Something that can display an email
struct MessageView: View {
@LazyInjectService private var snackbarPresenter: SnackBarPresentable

@EnvironmentObject var mailboxManager: MailboxManager

@State var presentableBody: PresentableBody
Expand Down Expand Up @@ -132,6 +135,7 @@ struct MessageView: View {
do {
try await mailboxManager.message(message: message)
} catch let error as MailApiError where error == .apiMessageNotFound {
snackbarPresenter.show(message: error.localizedDescription)
try await mailboxManager.refreshFolder(from: [message])
}
}
Expand Down

0 comments on commit 85e85f6

Please sign in to comment.