Skip to content

Commit 49c291a

Browse files
authored
Merge pull request #4319 from anyproto/ios-5541-do-not-show-x-members-under-the-space-name-on-widgets-screen
IOS-5541 Hide member count for one-to-one chats
2 parents b734d98 + 47f1bbb commit 49c291a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Anytype/Sources/PresentationLayer/Modules/HomeWidgets/Container/Submodule/WidgetsHeader/WidgetsHeaderView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct WidgetsHeaderView: View {
1818
AnytypeText(model.spaceName, style: .uxTitle2Semibold)
1919
.foregroundColor(.Text.primary)
2020
.lineLimit(1)
21-
if model.sharedSpace {
21+
if model.sharedSpace, !model.isOneToOne {
2222
AnytypeText(model.spaceMembers, style: .relation2Regular)
2323
.foregroundColor(.Control.transparentSecondary)
2424
} else {

Anytype/Sources/PresentationLayer/Modules/HomeWidgets/Container/Submodule/WidgetsHeader/WidgetsHeaderViewModel.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ final class WidgetsHeaderViewModel: ObservableObject {
2323
@Published var spaceUxType = ""
2424
@Published var spaceMembers = ""
2525
@Published var sharedSpace = false
26+
@Published var isOneToOne = false
2627
@Published var canEdit = false
2728

2829
init(spaceId: String, onSpaceSelected: @escaping () -> Void) {
@@ -51,6 +52,7 @@ final class WidgetsHeaderViewModel: ObservableObject {
5152
spaceIcon = space.objectIconImage
5253
spaceUxType = space.uxType.name
5354
sharedSpace = space.isShared
55+
isOneToOne = space.uxType.isOneToOne
5456
}
5557
}
5658

Anytype/Sources/PresentationLayer/SpaceSettings/SpaceSettings/SpaceSettingsView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ struct SpaceSettingsView: View {
9191
} label: {
9292
AnytypeText(model.spaceName.isNotEmpty ? model.spaceName : Loc.untitled, style: .heading)
9393
}
94-
Spacer.fixedHeight(4)
95-
AnytypeText(Loc.membersPlural(model.participantsCount), style: .caption1Regular).foregroundColor(.Text.secondary)
94+
if !model.isOneToOne {
95+
Spacer.fixedHeight(4)
96+
AnytypeText(Loc.membersPlural(model.participantsCount), style: .caption1Regular).foregroundColor(.Text.secondary)
97+
}
9698
}
9799
}
98100
}

0 commit comments

Comments
 (0)