Skip to content

Commit

Permalink
Fixed visibility for deleted messages indicator for current user
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski committed Oct 5, 2023
1 parent ae41f3d commit 2e67149
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### 🔄 Changed
### 🐞 Fixed
- Fixed visibility for deleted messages indicator for current user

# [4.38.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.38.0)
_September 29, 2023_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import SwiftUI

/// View displayed when a message is deleted.
public struct DeletedMessageView: View {
@Injected(\.chatClient) private var chatClient
@Injected(\.images) private var images
@Injected(\.fonts) private var fonts
@Injected(\.colors) private var colors
Expand All @@ -15,6 +16,10 @@ public struct DeletedMessageView: View {
private var dateFormatter: DateFormatter {
utils.dateFormatter
}

private var deletedMessageVisibility: ChatClientConfig.DeletedMessageVisibility {
chatClient.config.deletedMessagesVisibility
}

var message: ChatMessage
var isFirst: Bool
Expand All @@ -35,14 +40,16 @@ public struct DeletedMessageView: View {
HStack {
Spacer()

Image(uiImage: images.eye)
.customizable()
.frame(maxWidth: 12)
.accessibilityIdentifier("onlyVisibleToYouImageView")
if deletedMessageVisibility == .visibleForCurrentUser {
Image(uiImage: images.eye)
.customizable()
.frame(maxWidth: 12)
.accessibilityIdentifier("onlyVisibleToYouImageView")

Text(L10n.Message.onlyVisibleToYou)
.font(fonts.footnote)
.accessibilityIdentifier("onlyVisibleToYouLabel")
Text(L10n.Message.onlyVisibleToYou)
.font(fonts.footnote)
.accessibilityIdentifier("onlyVisibleToYouLabel")
}

Text(dateFormatter.string(from: message.createdAt))
.font(fonts.footnote)
Expand Down

0 comments on commit 2e67149

Please sign in to comment.