Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 6a61d97

Browse files
authored
Merge pull request #2526 from RocketChat/chore/hide_empty_information_details_channel
[CHORE] Hide empty information from Channel Information
2 parents 0b10cf1 + 914d070 commit 6a61d97

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

Rocket.Chat/Controllers/Chat/ChannelActionsViewController.swift

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,29 @@ class ChannelActionsViewController: BaseViewController {
4040
let hasAnnouncement = !(subscription.roomAnnouncement?.isEmpty ?? true)
4141
let hasTopic = !(subscription.roomTopic?.isEmpty ?? true)
4242

43-
header = [
44-
ChannelInfoBasicCellData(title: "#\(subscription.name)"),
45-
ChannelInfoDescriptionCellData(
43+
header = [ChannelInfoBasicCellData(title: "#\(subscription.name)")]
44+
45+
46+
if hasDescription {
47+
header?.append(ChannelInfoDescriptionCellData(
4648
title: localized("chat.info.item.description"),
47-
descriptionText: hasDescription ? subscription.roomDescription : localized("chat.info.item.no_description")
48-
),
49-
ChannelInfoDescriptionCellData(
49+
descriptionText: subscription.roomDescription
50+
))
51+
}
52+
53+
if hasAnnouncement {
54+
header?.append(ChannelInfoDescriptionCellData(
5055
title: localized("chat.info.item.announcement"),
51-
descriptionText: hasAnnouncement ?
52-
subscription.roomAnnouncement :
53-
localized("chat.info.item.no_announcement")
54-
),
55-
ChannelInfoDescriptionCellData(
56+
descriptionText: subscription.roomAnnouncement
57+
))
58+
}
59+
60+
if hasTopic {
61+
header?.append(ChannelInfoDescriptionCellData(
5662
title: localized("chat.info.item.topic"),
57-
descriptionText: hasTopic ? subscription.roomTopic : localized("chat.info.item.no_topic")
58-
)
59-
]
63+
descriptionText: subscription.roomTopic
64+
))
65+
}
6066
}
6167

6268
func title(for menuTitle: String) -> String {

0 commit comments

Comments
 (0)