@@ -48,7 +48,7 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
48
48
case . acceptRequest( let eventID) :
49
49
acceptRequest ( eventID: eventID)
50
50
case . declineRequest( let eventID) :
51
- guard let request = roomProxy. requestsToJoinPublisher . value. first ( where: { $0. eventID == eventID } ) else {
51
+ guard let request = roomProxy. joinRequestsPublisher . value. first ( where: { $0. eventID == eventID } ) else {
52
52
return
53
53
}
54
54
state. bindings. alertInfo = . init( id: . declineRequest,
@@ -59,7 +59,7 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
59
59
action: { [ weak self] in self ? . decline ( request: request) } ) ,
60
60
secondaryButton: . init( title: L10n . actionCancel, role: . cancel, action: nil ) )
61
61
case . ban( let eventID) :
62
- guard let request = roomProxy. requestsToJoinPublisher . value. first ( where: { $0. eventID == eventID } ) else {
62
+ guard let request = roomProxy. joinRequestsPublisher . value. first ( where: { $0. eventID == eventID } ) else {
63
63
return
64
64
}
65
65
state. bindings. alertInfo = . init( id: . declineAndBan,
@@ -74,11 +74,11 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
74
74
// MARK: - Private
75
75
76
76
private func acceptRequest( eventID: String ) {
77
- guard let request = roomProxy. requestsToJoinPublisher . value. first ( where: { $0. eventID == eventID } ) else {
77
+ guard let request = roomProxy. joinRequestsPublisher . value. first ( where: { $0. eventID == eventID } ) else {
78
78
return
79
79
}
80
80
81
- showLoadingIndicator ( )
81
+ showLoadingIndicator ( title : L10n . screenKnockRequestsListAcceptLoadingTitle )
82
82
defer { hideLoadingIndicator ( ) }
83
83
84
84
state. handledEventIDs. insert ( eventID)
@@ -94,8 +94,8 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
94
94
}
95
95
}
96
96
97
- private func decline( request: RequestToJoinProxyProtocol ) {
98
- showLoadingIndicator ( )
97
+ private func decline( request: JoinRequestProxyProtocol ) {
98
+ showLoadingIndicator ( title : L10n . screenKnockRequestsListDeclineLoadingTitle )
99
99
defer { hideLoadingIndicator ( ) }
100
100
101
101
let eventID = request. eventID
@@ -112,8 +112,8 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
112
112
}
113
113
}
114
114
115
- private func declineAndBan( request: RequestToJoinProxyProtocol ) {
116
- showLoadingIndicator ( )
115
+ private func declineAndBan( request: JoinRequestProxyProtocol ) {
116
+ showLoadingIndicator ( title : L10n . screenKnockRequestsListBanLoadingTitle )
117
117
defer { hideLoadingIndicator ( ) }
118
118
119
119
let eventID = request. eventID
@@ -131,13 +131,13 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
131
131
}
132
132
133
133
private func acceptAll( ) {
134
- showLoadingIndicator ( )
134
+ showLoadingIndicator ( title : L10n . screenKnockRequestsListAcceptAllLoadingTitle )
135
135
defer { hideLoadingIndicator ( ) }
136
136
137
- let requests = roomProxy. requestsToJoinPublisher . value
137
+ let requests = roomProxy. joinRequestsPublisher . value
138
138
state. handledEventIDs. formUnion ( Set ( requests. map ( \. eventID) ) )
139
139
Task {
140
- let failedIDs = await withTaskGroup ( of: ( String, Result < Void , RequestToJoinProxyError > ) . self) { group in
140
+ let failedIDs = await withTaskGroup ( of: ( String, Result < Void , JoinRequestProxyError > ) . self) { group in
141
141
for request in requests {
142
142
group. addTask {
143
143
await ( request. eventID, request. accept ( ) )
@@ -164,7 +164,7 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
164
164
}
165
165
. store ( in: & cancellables)
166
166
167
- roomProxy. requestsToJoinPublisher
167
+ roomProxy. joinRequestsPublisher
168
168
. map { $0. map ( KnockRequestCellInfo . init) }
169
169
. removeDuplicates ( )
170
170
. throttle ( for: . milliseconds( 100 ) , scheduler: DispatchQueue . main, latest: true )
@@ -189,12 +189,12 @@ class KnockRequestsListScreenViewModel: KnockRequestsListScreenViewModelType, Kn
189
189
190
190
private static let loadingIndicatorIdentifier = " \( KnockRequestsListScreenViewModel . self) -Loading "
191
191
192
- private func showLoadingIndicator( ) {
192
+ private func showLoadingIndicator( title : String ) {
193
193
userIndicatorController. submitIndicator ( UserIndicator ( id: Self . loadingIndicatorIdentifier,
194
194
type: . modal( progress: . indeterminate,
195
195
interactiveDismissDisabled: false ,
196
196
allowsInteraction: false ) ,
197
- title: L10n . commonLoading ,
197
+ title: title ,
198
198
persistent: true ) ,
199
199
delay: . seconds( 0.25 ) )
200
200
}
@@ -218,7 +218,7 @@ extension KnockRequestsListScreenViewModel {
218
218
}
219
219
220
220
extension KnockRequestCellInfo {
221
- init ( from proxy: RequestToJoinProxyProtocol ) {
221
+ init ( from proxy: JoinRequestProxyProtocol ) {
222
222
self . init ( eventID: proxy. eventID,
223
223
userID: proxy. userID,
224
224
displayName: proxy. displayName,
0 commit comments