mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Fix return value logic
This commit is contained in:
@@ -39,14 +39,13 @@ public struct Avatar {
|
||||
}
|
||||
|
||||
public func image(highlighted: Bool) -> UIImage {
|
||||
guard let image = image else {
|
||||
return placeholderImage
|
||||
|
||||
switch highlighted {
|
||||
case true:
|
||||
return highlightedImage ?? image ?? placeholderImage
|
||||
case false:
|
||||
return image ?? placeholderImage
|
||||
}
|
||||
|
||||
guard let highlightedImage = highlightedImage else {
|
||||
return image
|
||||
}
|
||||
|
||||
return highlighted ? image : highlightedImage
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@ public struct MessageBubble {
|
||||
public let highlightedImage: UIImage
|
||||
|
||||
public func image(highlighted: Bool) -> UIImage {
|
||||
return highlighted ? image : highlightedImage
|
||||
return highlighted ? highlightedImage : image
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user