Sfoglia il codice sorgente

fix(transcribing): Handle transcriber status changed.

* fix(subtitles): Handle errors to revert to default state.

* fix(transcribing): Handle transcriber status changed.

Drops potential transcribers and hidden participant actions and handling. Expect ljm to detect transcriptions on and off.

* feat(transcriptions): Adds a notification if transcriber leaves abruptly.

* squash: Renames action.

* chore(deps) lib-jitsi-meet@latest

https://github.com/jitsi/lib-jitsi-meet/compare/v1869.0.0+5671c5d6...v1872.0.0+8940b5c9
factor2
Дамян Минков 1 anno fa
parent
commit
d5269e881a
Nessun account collegato all'indirizzo email del committer

+ 11
- 0
conference.js Vedi File

164
 import { AudioMixerEffect } from './react/features/stream-effects/audio-mixer/AudioMixerEffect';
164
 import { AudioMixerEffect } from './react/features/stream-effects/audio-mixer/AudioMixerEffect';
165
 import { createRnnoiseProcessor } from './react/features/stream-effects/rnnoise';
165
 import { createRnnoiseProcessor } from './react/features/stream-effects/rnnoise';
166
 import { handleToggleVideoMuted } from './react/features/toolbox/actions.any';
166
 import { handleToggleVideoMuted } from './react/features/toolbox/actions.any';
167
+import { transcriberJoined, transcriberLeft } from './react/features/transcribing/actions';
167
 import { muteLocal } from './react/features/video-menu/actions.any';
168
 import { muteLocal } from './react/features/video-menu/actions.any';
168
 
169
 
169
 const logger = Logger.getLogger(__filename);
170
 const logger = Logger.getLogger(__filename);
1684
             }
1685
             }
1685
         );
1686
         );
1686
 
1687
 
1688
+        room.on(
1689
+            JitsiConferenceEvents.TRANSCRIPTION_STATUS_CHANGED,
1690
+            (status, id, abruptly) => {
1691
+                if (status === JitsiMeetJS.constants.transcriptionStatus.ON) {
1692
+                    APP.store.dispatch(transcriberJoined(id));
1693
+                } else if (status === JitsiMeetJS.constants.transcriptionStatus.OFF) {
1694
+                    APP.store.dispatch(transcriberLeft(id, abruptly));
1695
+                }
1696
+            });
1697
+
1687
         room.on(
1698
         room.on(
1688
             JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
1699
             JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
1689
             (participant, data) => {
1700
             (participant, data) => {

+ 1
- 1
config.js Vedi File

1721
     //     'toolbar.noAudioSignalTitle', // shown when a broken mic is detected
1721
     //     'toolbar.noAudioSignalTitle', // shown when a broken mic is detected
1722
     //     'toolbar.noisyAudioInputTitle', // shown when noise is detected for the current microphone
1722
     //     'toolbar.noisyAudioInputTitle', // shown when noise is detected for the current microphone
1723
     //     'toolbar.talkWhileMutedPopup', // shown when user tries to speak while muted
1723
     //     'toolbar.talkWhileMutedPopup', // shown when user tries to speak while muted
1724
-    //     'transcribing.failedToStart', // shown when transcribing fails to start
1724
+    //     'transcribing.failed', // shown when transcribing fails
1725
     // ],
1725
     // ],
1726
 
1726
 
1727
     // List of notifications to be disabled. Works in tandem with the above setting.
1727
     // List of notifications to be disabled. Works in tandem with the above setting.

+ 1
- 1
lang/main.json Vedi File

1390
     "transcribing": {
1390
     "transcribing": {
1391
         "ccButtonTooltip": "Start / Stop subtitles",
1391
         "ccButtonTooltip": "Start / Stop subtitles",
1392
         "expandedLabel": "Transcribing is currently on",
1392
         "expandedLabel": "Transcribing is currently on",
1393
-        "failedToStart": "Transcribing failed to start",
1393
+        "failed": "Transcribing failed",
1394
         "labelToolTip": "The meeting is being transcribed",
1394
         "labelToolTip": "The meeting is being transcribed",
1395
         "sourceLanguageDesc": "Currently the meeting language is set to <b>{{sourceLanguage}}</b>. <br/> You can change it from ",
1395
         "sourceLanguageDesc": "Currently the meeting language is set to <b>{{sourceLanguage}}</b>. <br/> You can change it from ",
1396
         "sourceLanguageHere": "here",
1396
         "sourceLanguageHere": "here",

+ 5
- 5
package-lock.json Vedi File

61
         "js-md5": "0.6.1",
61
         "js-md5": "0.6.1",
62
         "js-sha512": "0.8.0",
62
         "js-sha512": "0.8.0",
63
         "jwt-decode": "2.2.0",
63
         "jwt-decode": "2.2.0",
64
-        "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1869.0.0+5671c5d6/lib-jitsi-meet.tgz",
64
+        "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1872.0.0+8940b5c9/lib-jitsi-meet.tgz",
65
         "lodash-es": "4.17.21",
65
         "lodash-es": "4.17.21",
66
         "moment": "2.29.4",
66
         "moment": "2.29.4",
67
         "moment-duration-format": "2.2.2",
67
         "moment-duration-format": "2.2.2",
12498
     },
12498
     },
12499
     "node_modules/lib-jitsi-meet": {
12499
     "node_modules/lib-jitsi-meet": {
12500
       "version": "0.0.0",
12500
       "version": "0.0.0",
12501
-      "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1869.0.0+5671c5d6/lib-jitsi-meet.tgz",
12502
-      "integrity": "sha512-s2bAk8lq1SU/oQQxI9NTP2xOWI0yHFaFB7WjzL1E0gn6ntoaTH0FN1KQmJctfGGzm71I3lXy6SwgNHwi8hEtHA==",
12501
+      "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1872.0.0+8940b5c9/lib-jitsi-meet.tgz",
12502
+      "integrity": "sha512-/pcCiU7XguZ9ooOQ/HSQhU52kG3mvGtD15TWMsH/fbJwHG8Vt6TOA0DECyK/8xkPnRy1VCI7qt2e6zhk7VBgUA==",
12503
       "hasInstallScript": true,
12503
       "hasInstallScript": true,
12504
       "license": "Apache-2.0",
12504
       "license": "Apache-2.0",
12505
       "dependencies": {
12505
       "dependencies": {
28005
       }
28005
       }
28006
     },
28006
     },
28007
     "lib-jitsi-meet": {
28007
     "lib-jitsi-meet": {
28008
-      "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1869.0.0+5671c5d6/lib-jitsi-meet.tgz",
28009
-      "integrity": "sha512-s2bAk8lq1SU/oQQxI9NTP2xOWI0yHFaFB7WjzL1E0gn6ntoaTH0FN1KQmJctfGGzm71I3lXy6SwgNHwi8hEtHA==",
28008
+      "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1872.0.0+8940b5c9/lib-jitsi-meet.tgz",
28009
+      "integrity": "sha512-/pcCiU7XguZ9ooOQ/HSQhU52kG3mvGtD15TWMsH/fbJwHG8Vt6TOA0DECyK/8xkPnRy1VCI7qt2e6zhk7VBgUA==",
28010
       "requires": {
28010
       "requires": {
28011
         "@jitsi/js-utils": "2.2.1",
28011
         "@jitsi/js-utils": "2.2.1",
28012
         "@jitsi/logger": "2.0.2",
28012
         "@jitsi/logger": "2.0.2",

+ 1
- 1
package.json Vedi File

67
     "js-md5": "0.6.1",
67
     "js-md5": "0.6.1",
68
     "js-sha512": "0.8.0",
68
     "js-sha512": "0.8.0",
69
     "jwt-decode": "2.2.0",
69
     "jwt-decode": "2.2.0",
70
-    "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1869.0.0+5671c5d6/lib-jitsi-meet.tgz",
70
+    "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1872.0.0+8940b5c9/lib-jitsi-meet.tgz",
71
     "lodash-es": "4.17.21",
71
     "lodash-es": "4.17.21",
72
     "moment": "2.29.4",
72
     "moment": "2.29.4",
73
     "moment-duration-format": "2.2.2",
73
     "moment-duration-format": "2.2.2",

+ 12
- 1
react/features/base/conference/actions.any.ts Vedi File

1
 import { createStartMutedConfigurationEvent } from '../../analytics/AnalyticsEvents';
1
 import { createStartMutedConfigurationEvent } from '../../analytics/AnalyticsEvents';
2
 import { sendAnalytics } from '../../analytics/functions';
2
 import { sendAnalytics } from '../../analytics/functions';
3
 import { IReduxState, IStore } from '../../app/types';
3
 import { IReduxState, IStore } from '../../app/types';
4
+import { transcriberJoined, transcriberLeft } from '../../transcribing/actions';
4
 import { setIAmVisitor } from '../../visitors/actions';
5
 import { setIAmVisitor } from '../../visitors/actions';
5
 import { iAmVisitor } from '../../visitors/functions';
6
 import { iAmVisitor } from '../../visitors/functions';
6
 import { overwriteConfig } from '../config/actions';
7
 import { overwriteConfig } from '../config/actions';
8
 import { connect, disconnect, hangup } from '../connection/actions';
9
 import { connect, disconnect, hangup } from '../connection/actions';
9
 import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection/constants';
10
 import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection/constants';
10
 import { hasAvailableDevices } from '../devices/functions.any';
11
 import { hasAvailableDevices } from '../devices/functions.any';
11
-import { JitsiConferenceEvents, JitsiE2ePingEvents } from '../lib-jitsi-meet';
12
+import JitsiMeetJS, { JitsiConferenceEvents, JitsiE2ePingEvents } from '../lib-jitsi-meet';
12
 import {
13
 import {
13
     setAudioMuted,
14
     setAudioMuted,
14
     setAudioUnmutePermissions,
15
     setAudioUnmutePermissions,
276
             botType
277
             botType
277
         })));
278
         })));
278
 
279
 
280
+    conference.on(
281
+        JitsiConferenceEvents.TRANSCRIPTION_STATUS_CHANGED,
282
+        (status: string, id: string, abruptly: boolean) => {
283
+            if (status === JitsiMeetJS.constants.transcriptionStatus.ON) {
284
+                dispatch(transcriberJoined(id));
285
+            } else if (status === JitsiMeetJS.constants.transcriptionStatus.OFF) {
286
+                dispatch(transcriberLeft(id, abruptly));
287
+            }
288
+        });
289
+
279
     conference.addCommandListener(
290
     conference.addCommandListener(
280
         AVATAR_URL_COMMAND,
291
         AVATAR_URL_COMMAND,
281
         (data: { value: string; }, id: string) => {
292
         (data: { value: string; }, id: string) => {

+ 2
- 8
react/features/base/conference/functions.ts Vedi File

7
 import { IStateful } from '../app/types';
7
 import { IStateful } from '../app/types';
8
 import { JitsiTrackErrors } from '../lib-jitsi-meet';
8
 import { JitsiTrackErrors } from '../lib-jitsi-meet';
9
 import {
9
 import {
10
-    hiddenParticipantJoined,
11
-    hiddenParticipantLeft,
12
     participantJoined,
10
     participantJoined,
13
     participantLeft
11
     participantLeft
14
 } from '../participants/actions';
12
 } from '../participants/actions';
85
     const id = user.getId();
83
     const id = user.getId();
86
     const displayName = user.getDisplayName();
84
     const displayName = user.getDisplayName();
87
 
85
 
88
-    if (user.isHidden()) {
89
-        dispatch(hiddenParticipantJoined(id, displayName));
90
-    } else {
86
+    if (!user.isHidden()) {
91
         const isReplacing = user?.isReplacing();
87
         const isReplacing = user?.isReplacing();
92
 
88
 
93
         // the identity and avatar come from jwt and never change in the presence
89
         // the identity and avatar come from jwt and never change in the presence
122
         user: any) {
118
         user: any) {
123
     const id = user.getId();
119
     const id = user.getId();
124
 
120
 
125
-    if (user.isHidden()) {
126
-        dispatch(hiddenParticipantLeft(id));
127
-    } else {
121
+    if (!user.isHidden()) {
128
         const isReplaced = user.isReplaced?.();
122
         const isReplaced = user.isReplaced?.();
129
 
123
 
130
         dispatch(participantLeft(id, conference, { isReplaced }));
124
         dispatch(participantLeft(id, conference, { isReplaced }));

+ 0
- 22
react/features/base/participants/actionTypes.ts Vedi File

146
  */
146
  */
147
 export const PIN_PARTICIPANT = 'PIN_PARTICIPANT';
147
 export const PIN_PARTICIPANT = 'PIN_PARTICIPANT';
148
 
148
 
149
-/**
150
- * Action to signal that a hidden participant has joined.
151
- *
152
- * {
153
- *     type: HIDDEN_PARTICIPANT_JOINED,
154
- *     participant: Participant
155
- * }
156
- */
157
-export const HIDDEN_PARTICIPANT_JOINED = 'HIDDEN_PARTICIPANT_JOINED';
158
-
159
-/**
160
- * Action to handle case when hidden participant leaves.
161
- *
162
- * {
163
- *     type: PARTICIPANT_LEFT,
164
- *     participant: {
165
- *         id: string
166
- *     }
167
- * }
168
- */
169
-export const HIDDEN_PARTICIPANT_LEFT = 'HIDDEN_PARTICIPANT_LEFT';
170
-
171
 /**
149
 /**
172
  * The type of Redux action which notifies the app that the loadable avatar URL has changed.
150
  * The type of Redux action which notifies the app that the loadable avatar URL has changed.
173
  *
151
  *

+ 0
- 38
react/features/base/participants/actions.ts Vedi File

7
 import {
7
 import {
8
     DOMINANT_SPEAKER_CHANGED,
8
     DOMINANT_SPEAKER_CHANGED,
9
     GRANT_MODERATOR,
9
     GRANT_MODERATOR,
10
-    HIDDEN_PARTICIPANT_JOINED,
11
-    HIDDEN_PARTICIPANT_LEFT,
12
     KICK_PARTICIPANT,
10
     KICK_PARTICIPANT,
13
     LOCAL_PARTICIPANT_AUDIO_LEVEL_CHANGED,
11
     LOCAL_PARTICIPANT_AUDIO_LEVEL_CHANGED,
14
     LOCAL_PARTICIPANT_RAISE_HAND,
12
     LOCAL_PARTICIPANT_RAISE_HAND,
331
     };
329
     };
332
 }
330
 }
333
 
331
 
334
-/**
335
- * Action to signal that a hidden participant has joined the conference.
336
- *
337
- * @param {string} id - The id of the participant.
338
- * @param {string} displayName - The display name, or undefined when
339
- * unknown.
340
- * @returns {{
341
- *     type: HIDDEN_PARTICIPANT_JOINED,
342
- *     displayName: string,
343
- *     id: string
344
- * }}
345
- */
346
-export function hiddenParticipantJoined(id: string, displayName: string) {
347
-    return {
348
-        type: HIDDEN_PARTICIPANT_JOINED,
349
-        id,
350
-        displayName
351
-    };
352
-}
353
-
354
-/**
355
- * Action to signal that a hidden participant has left the conference.
356
- *
357
- * @param {string} id - The id of the participant.
358
- * @returns {{
359
- *     type: HIDDEN_PARTICIPANT_LEFT,
360
- *     id: string
361
- * }}
362
- */
363
-export function hiddenParticipantLeft(id: string) {
364
-    return {
365
-        type: HIDDEN_PARTICIPANT_LEFT,
366
-        id
367
-    };
368
-}
369
-
370
 /**
332
 /**
371
  * Action to signal that a participant has left.
333
  * Action to signal that a participant has left.
372
  *
334
  *

+ 1
- 1
react/features/subtitles/middleware.ts Vedi File

259
                     logger.error('Error dialing', e);
259
                     logger.error('Error dialing', e);
260
 
260
 
261
                     // let's back to the correct state
261
                     // let's back to the correct state
262
-                    dispatch(setRequestingSubtitles(false, false));
262
+                    dispatch(setRequestingSubtitles(false, false, null));
263
                 });
263
                 });
264
         }
264
         }
265
     }
265
     }

+ 6
- 0
react/features/subtitles/reducer.ts Vedi File

1
 import ReducerRegistry from '../base/redux/ReducerRegistry';
1
 import ReducerRegistry from '../base/redux/ReducerRegistry';
2
+import { TRANSCRIBER_LEFT } from '../transcribing/actionTypes';
2
 
3
 
3
 import {
4
 import {
4
     REMOVE_TRANSCRIPT_MESSAGE,
5
     REMOVE_TRANSCRIPT_MESSAGE,
48
             ...state,
49
             ...state,
49
             _requestingSubtitles: !state._requestingSubtitles
50
             _requestingSubtitles: !state._requestingSubtitles
50
         };
51
         };
52
+    case TRANSCRIBER_LEFT:
53
+        return {
54
+            ...state,
55
+            ...defaultState
56
+        };
51
     }
57
     }
52
 
58
 
53
     return state;
59
     return state;

+ 2
- 14
react/features/transcribing/actionTypes.ts Vedi File

8
  * }
8
  * }
9
  * @private
9
  * @private
10
  */
10
  */
11
-export const _TRANSCRIBER_JOINED = 'TRANSCRIBER_JOINED';
11
+export const TRANSCRIBER_JOINED = 'TRANSCRIBER_JOINED';
12
 
12
 
13
 /**
13
 /**
14
  * The type of Redux action signalling that the transcriber has left
14
  * The type of Redux action signalling that the transcriber has left
19
  * }
19
  * }
20
  * @private
20
  * @private
21
  */
21
  */
22
-export const _TRANSCRIBER_LEFT = 'TRANSCRIBER_LEFT';
23
-
24
-/**
25
- * The type of a Redux action signalling that a hidden participant has joined,
26
- * which can be candidate for being a transcriber.
27
- *
28
- * {
29
- *     type: _POTENTIAL_TRANSCRIBER_JOINED,
30
- * }
31
- * @private
32
- */
33
-export const _POTENTIAL_TRANSCRIBER_JOINED
34
-    = 'POTENTIAL_TRANSCRIBER_JOINED';
22
+export const TRANSCRIBER_LEFT = 'TRANSCRIBER_LEFT';

+ 13
- 26
react/features/transcribing/actions.ts Vedi File

1
 import {
1
 import {
2
-    _POTENTIAL_TRANSCRIBER_JOINED,
3
-    _TRANSCRIBER_JOINED,
4
-    _TRANSCRIBER_LEFT
2
+    TRANSCRIBER_JOINED,
3
+    TRANSCRIBER_LEFT
5
 } from './actionTypes';
4
 } from './actionTypes';
6
 
5
 
7
 /**
6
 /**
9
  *
8
  *
10
  * @param {string} participantId - The participant id of the transcriber.
9
  * @param {string} participantId - The participant id of the transcriber.
11
  * @returns {{
10
  * @returns {{
12
- *     type: _TRANSCRIBER_JOINED,
11
+ *     type: TRANSCRIBER_JOINED,
13
  *     participantId: string
12
  *     participantId: string
14
  * }}
13
  * }}
15
  */
14
  */
16
 export function transcriberJoined(participantId: string) {
15
 export function transcriberJoined(participantId: string) {
17
     return {
16
     return {
18
-        type: _TRANSCRIBER_JOINED,
17
+        type: TRANSCRIBER_JOINED,
19
         transcriberJID: participantId
18
         transcriberJID: participantId
20
     };
19
     };
21
 }
20
 }
24
  * Notify that the transcriber, with a unique ID, has left.
23
  * Notify that the transcriber, with a unique ID, has left.
25
  *
24
  *
26
  * @param {string} participantId - The participant id of the transcriber.
25
  * @param {string} participantId - The participant id of the transcriber.
26
+ * @param {boolean} abruptly - The transcriber did not exit the conference gracefully with switching off first.
27
+ * It maybe there was some backend problem, like network.
27
  * @returns {{
28
  * @returns {{
28
- *     type: _TRANSCRIBER_LEFT,
29
- *     participantId: string
30
- * }}
31
- */
32
-export function transcriberLeft(participantId: string) {
33
-    return {
34
-        type: _TRANSCRIBER_LEFT,
35
-        transcriberJID: participantId
36
-    };
37
-}
38
-
39
-/**
40
- * Notify that a potential transcriber, with a unique ID, has joined.
41
- *
42
- * @param {string} participantId - The participant id of the transcriber.
43
- * @returns {{
44
- *     type: _POTENTIAL_TRANSCRIBER_JOINED,
45
- *     participantId: string
29
+ *     type: TRANSCRIBER_LEFT,
30
+ *     participantId: string,
31
+ *     abruptly: boolean
46
  * }}
32
  * }}
47
  */
33
  */
48
-export function potentialTranscriberJoined(participantId: string) {
34
+export function transcriberLeft(participantId: string, abruptly: boolean) {
49
     return {
35
     return {
50
-        type: _POTENTIAL_TRANSCRIBER_JOINED,
51
-        transcriberJID: participantId
36
+        type: TRANSCRIBER_LEFT,
37
+        transcriberJID: participantId,
38
+        abruptly
52
     };
39
     };
53
 }
40
 }

+ 9
- 41
react/features/transcribing/middleware.ts Vedi File

1
-import {
2
-    HIDDEN_PARTICIPANT_JOINED,
3
-    HIDDEN_PARTICIPANT_LEFT,
4
-    PARTICIPANT_UPDATED
5
-} from '../base/participants/actionTypes';
6
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
1
 import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
2
+import { showErrorNotification } from '../notifications/actions';
3
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
7
 
4
 
8
-import {
9
-    potentialTranscriberJoined,
10
-    transcriberJoined,
11
-    transcriberLeft
12
-} from './actions';
13
-import './subscriber';
14
-
15
-const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
5
+import { TRANSCRIBER_LEFT } from './actionTypes';
16
 
6
 
17
 /**
7
 /**
18
  * Implements the middleware of the feature transcribing.
8
  * Implements the middleware of the feature transcribing.
20
  * @param {Store} store - The redux store.
10
  * @param {Store} store - The redux store.
21
  * @returns {Function}
11
  * @returns {Function}
22
  */
12
  */
23
-// eslint-disable-next-line no-unused-vars
24
-MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
25
-    const {
26
-        transcriberJID,
27
-        potentialTranscriberJIDs
28
-    } = getState()['features/transcribing'];
29
-
13
+MiddlewareRegistry.register(({ dispatch }) => next => action => {
30
     switch (action.type) {
14
     switch (action.type) {
31
-    case HIDDEN_PARTICIPANT_JOINED:
32
-        if (action.displayName === TRANSCRIBER_DISPLAY_NAME) {
33
-            dispatch(transcriberJoined(action.id));
34
-        } else {
35
-            dispatch(potentialTranscriberJoined(action.id));
36
-        }
37
-
38
-        break;
39
-    case HIDDEN_PARTICIPANT_LEFT:
40
-        if (action.id === transcriberJID) {
41
-            dispatch(transcriberLeft(action.id));
15
+    case TRANSCRIBER_LEFT:
16
+        if (action.abruptly) {
17
+            dispatch(showErrorNotification({
18
+                titleKey: 'transcribing.failed'
19
+            }, NOTIFICATION_TIMEOUT_TYPE.LONG));
42
         }
20
         }
43
         break;
21
         break;
44
-    case PARTICIPANT_UPDATED: {
45
-        const { participant } = action;
46
-
47
-        if (potentialTranscriberJIDs.includes(participant.id) && participant.name === TRANSCRIBER_DISPLAY_NAME) {
48
-            dispatch(transcriberJoined(participant.id));
49
-        }
50
-
51
-        break;
52
-    }
53
-
54
     }
22
     }
55
 
23
 
56
     return next(action);
24
     return next(action);

+ 7
- 23
react/features/transcribing/reducer.ts Vedi File

1
 import ReducerRegistry from '../base/redux/ReducerRegistry';
1
 import ReducerRegistry from '../base/redux/ReducerRegistry';
2
 
2
 
3
 import {
3
 import {
4
-    _POTENTIAL_TRANSCRIBER_JOINED,
5
-    _TRANSCRIBER_JOINED,
6
-    _TRANSCRIBER_LEFT
4
+    TRANSCRIBER_JOINED,
5
+    TRANSCRIBER_LEFT
7
 } from './actionTypes';
6
 } from './actionTypes';
8
 
7
 
9
 /**
8
 /**
11
  *
10
  *
12
  * @returns {{
11
  * @returns {{
13
  * isTranscribing: boolean,
12
  * isTranscribing: boolean,
14
- * transcriberJID: null,
15
- * potentialTranscriberJIDs: Array
13
+ * transcriberJID: null
16
  * }}
14
  * }}
17
  * @private
15
  * @private
18
  */
16
  */
31
          *
29
          *
32
          * @type { string }
30
          * @type { string }
33
          */
31
          */
34
-        transcriberJID: null,
35
-
36
-        /**
37
-         * A list containing potential JID's of transcriber participants.
38
-         *
39
-         * @type { Array }
40
-         */
41
-        potentialTranscriberJIDs: []
32
+        transcriberJID: null
42
     };
33
     };
43
 }
34
 }
44
 
35
 
45
 export interface ITranscribingState {
36
 export interface ITranscribingState {
46
     isTranscribing: boolean;
37
     isTranscribing: boolean;
47
-    potentialTranscriberJIDs: string[];
48
     transcriberJID?: string | null;
38
     transcriberJID?: string | null;
49
 }
39
 }
50
 
40
 
54
 ReducerRegistry.register<ITranscribingState>('features/transcribing',
44
 ReducerRegistry.register<ITranscribingState>('features/transcribing',
55
     (state = _getInitialState(), action): ITranscribingState => {
45
     (state = _getInitialState(), action): ITranscribingState => {
56
         switch (action.type) {
46
         switch (action.type) {
57
-        case _TRANSCRIBER_JOINED:
47
+        case TRANSCRIBER_JOINED:
58
             return {
48
             return {
59
                 ...state,
49
                 ...state,
60
                 isTranscribing: true,
50
                 isTranscribing: true,
61
                 transcriberJID: action.transcriberJID
51
                 transcriberJID: action.transcriberJID
62
             };
52
             };
63
-        case _TRANSCRIBER_LEFT:
53
+        case TRANSCRIBER_LEFT:
64
             return {
54
             return {
65
                 ...state,
55
                 ...state,
66
                 isTranscribing: false,
56
                 isTranscribing: false,
67
-                transcriberJID: undefined,
68
-                potentialTranscriberJIDs: []
69
-            };
70
-        case _POTENTIAL_TRANSCRIBER_JOINED:
71
-            return {
72
-                ...state,
73
-                potentialTranscriberJIDs: [ action.transcriberJID, ...state.potentialTranscriberJIDs ]
57
+                transcriberJID: undefined
74
             };
58
             };
75
         default:
59
         default:
76
             return state;
60
             return state;

Loading…
Annulla
Salva