diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 6dc88d21cc..b84fb55adb 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -519,14 +519,20 @@ struct ChatView: View { } private func setDate(visibility isVisible: Bool) { - if isVisible { - if !isNearBottom, - !isDateVisible, - let date, !Calendar.current.isDateInToday(date) { - withAnimation { isDateVisible = true } + Task { + if isVisible { + if !isNearBottom, + !isDateVisible, + let date, !Calendar.current.isDateInToday(date) { + await MainActor.run { + withAnimation { isDateVisible = true } + } + } + } else if isDateVisible { + await MainActor.run { + withAnimation { isDateVisible = false } + } } - } else if isDateVisible { - withAnimation { isDateVisible = false } } }