Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ final class NewSpaceShareViewModel: ObservableObject {
canChangeInvite = participantSpaceView.permissions.canEditPermissions && participantSpaceView.permissions.canDeleteLink

updateUpgradeViewState()

rows = participants.map { participant in

let filteredParticipants = participantSpaceView.permissions.canEditPermissions ? participants : participants.filter { $0.status == .active }

rows = filteredParticipants.map { participant in
let isYou = workspaceInfo.profileObjectID == participant.identityProfileLink
return SpaceShareParticipantViewModel(
id: participant.id,
Expand Down Expand Up @@ -157,6 +159,7 @@ final class NewSpaceShareViewModel: ObservableObject {
}

private func participantContextActions(_ participant: Participant) -> [SpaceShareParticipantViewModel.ContextAction] {
guard let participantSpaceView, participantSpaceView.permissions.canEditPermissions else { return [] }
guard participant.permission != .owner else { return [] }
switch participant.status {
case .active:
Expand Down Expand Up @@ -199,7 +202,7 @@ final class NewSpaceShareViewModel: ObservableObject {
}
)] : []
case .removing:
return [
return canApproveRequests ? [
SpaceShareParticipantViewModel.ContextAction(
title: Loc.SpaceShare.Action.approve,
isSelected: false,
Expand All @@ -210,7 +213,7 @@ final class NewSpaceShareViewModel: ObservableObject {
try await self?.workspaceService.leaveApprove(spaceId: participant.spaceId, identity: participant.identity)
self?.toastBarData = ToastBarData(Loc.SpaceShare.Approve.toast(participant.title))
}
)]
)] : []
case .removed, .declined, .canceled, .UNRECOGNIZED(_):
return []
}
Expand Down
Loading