From 95797d427c4cc6217f55f296c98fff813900fcf5 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Thu, 17 Mar 2022 10:43:11 +1100 Subject: [PATCH] fix link preview text colour --- .../Message Cells/Content Views/LinkPreviewView.swift | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Session/Conversations/Message Cells/Content Views/LinkPreviewView.swift b/Session/Conversations/Message Cells/Content Views/LinkPreviewView.swift index a9bd6f3c5..f6ef16991 100644 --- a/Session/Conversations/Message Cells/Content Views/LinkPreviewView.swift +++ b/Session/Conversations/Message Cells/Content Views/LinkPreviewView.swift @@ -12,6 +12,7 @@ final class LinkPreviewView : UIView { let isOutgoing = (viewItem!.interaction.interactionType() == .outgoingMessage) switch (isOutgoing, AppModeManager.shared.currentAppMode) { case (true, .dark), (false, .light): return .black + case (true, .light): return Colors.grey default: return .white } }() @@ -133,15 +134,7 @@ final class LinkPreviewView : UIView { loader.alpha = (image != nil) ? 0 : 1 if image != nil { loader.stopAnimating() } else { loader.startAnimating() } // Title - let isSent = (linkPreviewState is LinkPreviewSent) - let isOutgoing = (viewItem?.interaction.interactionType() == .outgoingMessage) - let textColor: UIColor - if isSent && isOutgoing && isLightMode { - textColor = .white - } else { - textColor = isDarkMode ? .white : .black - } - titleLabel.textColor = textColor + titleLabel.textColor = sentLinkPreviewTextColor titleLabel.text = linkPreviewState.title() // Horizontal stack view switch linkPreviewState {