2
2
// Licensed under the MIT License.
3
3
4
4
import { CallClientState , CaptionsInfo } from '@internal/calling-stateful-client' ;
5
- /* @conditional -compile-remove(rtt) */
6
5
import { RealTimeTextInfo , RemoteParticipantState } from '@internal/calling-stateful-client' ;
7
6
import {
8
7
CallingBaseSelectorProps ,
@@ -13,7 +12,6 @@ import {
13
12
getStartCaptionsInProgress ,
14
13
getSupportedCaptionLanguages
15
14
} from './baseSelectors' ;
16
- /* @conditional -compile-remove(rtt) */
17
15
import { getRealTimeTextStatus , getRealTimeText } from './baseSelectors' ;
18
16
import {
19
17
getCaptions ,
@@ -25,7 +23,6 @@ import {
25
23
import * as reselect from 'reselect' ;
26
24
import { toFlatCommunicationIdentifier } from '@internal/acs-ui-common' ;
27
25
import { CaptionsInformation , SupportedCaptionLanguage , SupportedSpokenLanguage } from '@internal/react-components' ;
28
- /* @conditional -compile-remove(rtt) */
29
26
import { RealTimeTextInformation } from '@internal/react-components' ;
30
27
import { getRemoteParticipantDisplayName } from './utils/callUtils' ;
31
28
@@ -111,17 +108,14 @@ export type CaptionsBannerSelector = (
111
108
props : CallingBaseSelectorProps
112
109
) => {
113
110
captions : CaptionsInformation [ ] ;
114
- /* @conditional -compile-remove(rtt) */
115
111
realTimeTexts : {
116
112
completedMessages ?: RealTimeTextInformation [ ] ;
117
113
currentInProgress ?: RealTimeTextInformation [ ] ;
118
114
myInProgress ?: RealTimeTextInformation ;
119
115
} ;
120
116
isCaptionsOn : boolean ;
121
117
startCaptionsInProgress : boolean ;
122
- /* @conditional -compile-remove(rtt) */
123
118
isRealTimeTextOn : boolean ;
124
- /* @conditional -compile-remove(rtt) */
125
119
latestLocalRealTimeText : RealTimeTextInformation ;
126
120
} ;
127
121
@@ -133,10 +127,8 @@ export type CaptionsBannerSelector = (
133
127
export const captionsBannerSelector : CaptionsBannerSelector = reselect . createSelector (
134
128
[
135
129
getCaptions ,
136
- /* @conditional -compile-remove(rtt) */
137
130
getRealTimeText ,
138
131
getCaptionsStatus ,
139
- /* @conditional -compile-remove(rtt) */
140
132
getRealTimeTextStatus ,
141
133
getStartCaptionsInProgress ,
142
134
getRemoteParticipants ,
@@ -146,10 +138,8 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel
146
138
] ,
147
139
(
148
140
captions ,
149
- /* @conditional -compile-remove(rtt) */
150
141
realTimeTexts ,
151
142
isCaptionsFeatureActive ,
152
- /* @conditional -compile-remove(rtt) */
153
143
isRealTimeTextActive ,
154
144
startCaptionsInProgress ,
155
145
remoteParticipants ,
@@ -174,7 +164,7 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel
174
164
createdTimeStamp : c . timestamp
175
165
} ;
176
166
} ) ;
177
- /* @conditional -compile-remove(rtt) */
167
+
178
168
const completedRealTimeTexts = realTimeTexts ?. completedMessages
179
169
?. filter ( ( rtt ) => rtt . message !== '' )
180
170
. map ( ( rtt ) => {
@@ -196,7 +186,7 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel
196
186
finalizedTimeStamp : rtt . updatedTimestamp
197
187
} ;
198
188
} ) ;
199
- /* @conditional -compile-remove(rtt) */
189
+
200
190
const inProgressRealTimeTexts = realTimeTexts ?. currentInProgress
201
191
?. filter ( ( rtt ) => rtt . message !== '' )
202
192
. map ( ( rtt ) => {
@@ -218,7 +208,7 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel
218
208
finalizedTimeStamp : rtt . updatedTimestamp
219
209
} ;
220
210
} ) ;
221
- /* @conditional -compile-remove(rtt) */
211
+
222
212
const myInProgress =
223
213
realTimeTexts ?. myInProgress && realTimeTexts . myInProgress . message !== ''
224
214
? {
@@ -232,10 +222,9 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel
232
222
}
233
223
: undefined ;
234
224
235
- /* @conditional -compile-remove(rtt) */
236
225
// find the last final local real time text caption if myInProgress is not available
237
226
let latestLocalRealTimeText ;
238
- /* @conditional -compile-remove(rtt) */
227
+
239
228
if ( ! myInProgress ) {
240
229
latestLocalRealTimeText =
241
230
realTimeTexts &&
@@ -248,17 +237,17 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel
248
237
249
238
return {
250
239
captions : captionsInfo ?? [ ] ,
251
- /* @conditional -compile-remove(rtt) */
240
+
252
241
realTimeTexts : {
253
242
completedMessages : completedRealTimeTexts as RealTimeTextInformation [ ] ,
254
243
currentInProgress : inProgressRealTimeTexts as RealTimeTextInformation [ ] ,
255
244
myInProgress : myInProgress as RealTimeTextInformation
256
245
} ,
257
246
isCaptionsOn : isCaptionsFeatureActive ?? false ,
258
247
startCaptionsInProgress : startCaptionsInProgress ?? false ,
259
- /* @conditional -compile-remove(rtt) */
248
+
260
249
isRealTimeTextOn : isRealTimeTextActive ?? false ,
261
- /* @conditional -compile-remove(rtt) */
250
+
262
251
latestLocalRealTimeText : ( myInProgress ?? latestLocalRealTimeText ) as RealTimeTextInformation
263
252
} ;
264
253
}
@@ -267,12 +256,11 @@ export const captionsBannerSelector: CaptionsBannerSelector = reselect.createSel
267
256
const getCaptionsSpeakerIdentifier = ( captions : CaptionsInfo ) : string => {
268
257
return captions . speaker . identifier ? toFlatCommunicationIdentifier ( captions . speaker . identifier ) : '' ;
269
258
} ;
270
- /* @conditional -compile-remove(rtt) */
259
+
271
260
const getRealTimeTextSpeakerIdentifier = ( realTimeText : RealTimeTextInfo ) : string => {
272
261
return realTimeText . sender . identifier ? toFlatCommunicationIdentifier ( realTimeText . sender . identifier ) : '' ;
273
262
} ;
274
263
275
- /* @conditional -compile-remove(rtt) */
276
264
const getRealTimeTextDisplayName = (
277
265
realTimeText : RealTimeTextInfo ,
278
266
identifier : string ,
0 commit comments