Browse Source

ref(TS) Convert some features to TS (#12591)

factor2
Robert Pintilii 2 years ago
parent
commit
643cc2db81
No account linked to committer's email address
30 changed files with 166 additions and 191 deletions
  1. 1
    0
      globals.d.ts
  2. 4
    4
      react/features/base/conference/functions.ts
  3. 4
    2
      react/features/base/conference/reducer.ts
  4. 1
    1
      react/features/base/tracks/functions.any.ts
  5. 2
    3
      react/features/display-name/components/web/StageParticipantNameLabel.tsx
  6. 0
    0
      react/features/keyboard-shortcuts/actions.ts
  7. 2
    7
      react/features/keyboard-shortcuts/middleware.ts
  8. 11
    13
      react/features/large-video/actions.any.ts
  9. 0
    2
      react/features/large-video/actions.native.ts
  10. 10
    12
      react/features/large-video/actions.web.ts
  11. 0
    15
      react/features/large-video/functions.js
  12. 14
    0
      react/features/large-video/functions.ts
  13. 0
    2
      react/features/large-video/logger.ts
  14. 6
    9
      react/features/large-video/middleware.ts
  15. 0
    0
      react/features/large-video/subscriber.native.ts
  16. 4
    5
      react/features/large-video/subscriber.web.ts
  17. 34
    37
      react/features/lobby/actions.any.ts
  18. 3
    2
      react/features/lobby/actions.native.ts
  19. 3
    8
      react/features/lobby/actions.web.ts
  20. 14
    12
      react/features/lobby/functions.ts
  21. 0
    2
      react/features/lobby/logger.ts
  22. 33
    31
      react/features/lobby/middleware.ts
  23. 1
    5
      react/features/lobby/reducer.ts
  24. 0
    0
      react/features/lobby/sounds.ts
  25. 5
    0
      react/features/lobby/types.ts
  26. 1
    3
      react/features/old-client-notification/functions.ts
  27. 8
    8
      react/features/old-client-notification/middleware.tsx
  28. 1
    3
      react/features/participants-pane/components/web/LobbyParticipants.tsx
  29. 3
    5
      react/features/participants-pane/hooks.web.ts
  30. 1
    0
      tsconfig.native.json

+ 1
- 0
globals.d.ts View File

@@ -13,6 +13,7 @@ declare global {
13 13
         keyboardshortcut: {
14 14
             registerShortcut: Function;
15 15
             unregisterShortcut: Function;
16
+            openDialog: Function;
16 17
         }
17 18
     };
18 19
     const interfaceConfig: any;

+ 4
- 4
react/features/base/conference/functions.ts View File

@@ -454,18 +454,18 @@ export function sendLocalParticipant(
454 454
         name
455 455
     } = getLocalParticipant(stateful) ?? {};
456 456
 
457
-    avatarURL && conference.sendCommand(AVATAR_URL_COMMAND, {
457
+    avatarURL && conference?.sendCommand(AVATAR_URL_COMMAND, {
458 458
         value: avatarURL
459 459
     });
460
-    email && conference.sendCommand(EMAIL_COMMAND, {
460
+    email && conference?.sendCommand(EMAIL_COMMAND, {
461 461
         value: email
462 462
     });
463 463
 
464 464
     if (features && features['screen-sharing'] === 'true') {
465
-        conference.setLocalParticipantProperty('features_screen-sharing', true);
465
+        conference?.setLocalParticipantProperty('features_screen-sharing', true);
466 466
     }
467 467
 
468
-    conference.setDisplayName(name);
468
+    conference?.setDisplayName(name);
469 469
 }
470 470
 
471 471
 /**

+ 4
- 2
react/features/base/conference/reducer.ts View File

@@ -65,6 +65,7 @@ export interface IJitsiConference {
65 65
     isStartAudioMuted: Function;
66 66
     isStartVideoMuted: Function;
67 67
     join: Function;
68
+    joinLobby: Function;
68 69
     kickParticipant: Function;
69 70
     lock: Function;
70 71
     muteParticipant: Function;
@@ -104,7 +105,7 @@ export interface IConferenceState {
104 105
     leaving?: Object;
105 106
     localSubject?: string;
106 107
     locked?: string;
107
-    membersOnly?: Object;
108
+    membersOnly?: IJitsiConference;
108 109
     obfuscatedRoom?: string;
109 110
     obfuscatedRoomSource?: string;
110 111
     p2p?: Object;
@@ -227,7 +228,8 @@ function _authStatusChanged(state: IConferenceState,
227 228
  * @returns {Object} The new state of the feature base/conference after the
228 229
  * reduction of the specified action.
229 230
  */
230
-function _conferenceFailed(state: IConferenceState, { conference, error }: { conference: Object; error: Error; }) {
231
+function _conferenceFailed(state: IConferenceState, { conference, error }: {
232
+    conference: IJitsiConference; error: Error; }) {
231 233
     // The current (similar to getCurrentConference in
232 234
     // base/conference/functions.any.js) conference which is joining or joined:
233 235
     const conference_ = state.conference || state.joining;

+ 1
- 1
react/features/base/tracks/functions.any.ts View File

@@ -214,7 +214,7 @@ export function getVideoTrackByParticipant(
214 214
 export function getTrackByMediaTypeAndParticipant(
215 215
         tracks: ITrack[],
216 216
         mediaType: MediaType,
217
-        participantId: string) {
217
+        participantId?: string) {
218 218
     return tracks.find(
219 219
         t => Boolean(t.jitsiTrack) && t.participantId === participantId && t.mediaType === mediaType
220 220
     );

+ 2
- 3
react/features/display-name/components/web/StageParticipantNameLabel.tsx View File

@@ -11,7 +11,6 @@ import {
11 11
     getParticipantDisplayName,
12 12
     isWhiteboardParticipant
13 13
 } from '../../../base/participants/functions';
14
-import { IParticipant } from '../../../base/participants/types';
15 14
 import { withPixelLineHeight } from '../../../base/styles/functions.web';
16 15
 // @ts-ignore
17 16
 import { getLargeVideoParticipant } from '../../../large-video/functions';
@@ -50,9 +49,9 @@ const useStyles = makeStyles()(theme => {
50 49
  */
51 50
 const StageParticipantNameLabel = () => {
52 51
     const { classes, cx } = useStyles();
53
-    const largeVideoParticipant: IParticipant = useSelector(getLargeVideoParticipant);
52
+    const largeVideoParticipant = useSelector(getLargeVideoParticipant);
54 53
     const selectedId = largeVideoParticipant?.id;
55
-    const nameToDisplay = useSelector((state: IReduxState) => getParticipantDisplayName(state, selectedId));
54
+    const nameToDisplay = useSelector((state: IReduxState) => getParticipantDisplayName(state, selectedId ?? ''));
56 55
 
57 56
     const localParticipant = useSelector(getLocalParticipant);
58 57
     const localId = localParticipant?.id;

react/features/keyboard-shortcuts/actions.js → react/features/keyboard-shortcuts/actions.ts View File


react/features/keyboard-shortcuts/middleware.js → react/features/keyboard-shortcuts/middleware.ts View File

@@ -1,19 +1,14 @@
1
-// @flow
2
-
3
-import { MiddlewareRegistry } from '../base/redux';
1
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
4 2
 
5 3
 import { OPEN_KEYBOARD_SHORTCUTS_DIALOG } from './actionTypes';
6 4
 
7
-declare var APP: Object;
8
-
9 5
 /**
10 6
  * Implements the middleware of the feature keyboard-shortcuts.
11 7
  *
12 8
  * @param {Store} store - The redux store.
13 9
  * @returns {Function}
14 10
  */
15
-// eslint-disable-next-line no-unused-vars
16
-MiddlewareRegistry.register(store => next => action => {
11
+MiddlewareRegistry.register(_store => next => action => {
17 12
     switch (action.type) {
18 13
     case OPEN_KEYBOARD_SHORTCUTS_DIALOG:
19 14
         if (typeof APP === 'object') {

react/features/large-video/actions.any.js → react/features/large-video/actions.any.ts View File

@@ -1,8 +1,5 @@
1
-// @flow
2
-
3
-import type { Dispatch } from 'redux';
4
-
5
-import { MEDIA_TYPE } from '../base/media';
1
+import { IReduxState, IStore } from '../app/types';
2
+import { MEDIA_TYPE } from '../base/media/constants';
6 3
 import {
7 4
     getDominantSpeakerParticipant,
8 5
     getLocalParticipant,
@@ -10,9 +7,10 @@ import {
10 7
     getPinnedParticipant,
11 8
     getRemoteParticipants,
12 9
     getVirtualScreenshareParticipantByOwnerId
13
-} from '../base/participants';
10
+} from '../base/participants/functions';
11
+import { ITrack } from '../base/tracks/types';
14 12
 import { isStageFilmstripAvailable } from '../filmstrip/functions';
15
-import { getAutoPinSetting } from '../video-layout';
13
+import { getAutoPinSetting } from '../video-layout/functions';
16 14
 
17 15
 import {
18 16
     SELECT_LARGE_VIDEO_PARTICIPANT,
@@ -30,8 +28,8 @@ import {
30 28
  * displayed on the large video.
31 29
  * @returns {Function}
32 30
  */
33
-export function selectParticipantInLargeVideo(participant: ?string) {
34
-    return (dispatch: Dispatch<any>, getState: Function) => {
31
+export function selectParticipantInLargeVideo(participant?: string) {
32
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
35 33
         const state = getState();
36 34
 
37 35
         if (isStageFilmstripAvailable(state, 2)) {
@@ -48,7 +46,7 @@ export function selectParticipantInLargeVideo(participant: ?string) {
48 46
         const remoteScreenShares = state['features/video-layout'].remoteScreenShares;
49 47
         let latestScreenshareParticipantId;
50 48
 
51
-        if (remoteScreenShares && remoteScreenShares.length) {
49
+        if (remoteScreenShares?.length) {
52 50
             latestScreenshareParticipantId = remoteScreenShares[remoteScreenShares.length - 1];
53 51
         }
54 52
 
@@ -94,7 +92,7 @@ export function updateKnownLargeVideoResolution(resolution: number) {
94 92
  *     width: number
95 93
  * }}
96 94
  */
97
-export function setLargeVideoDimensions(height, width) {
95
+export function setLargeVideoDimensions(height: number, width: number) {
98 96
     return {
99 97
         type: SET_LARGE_VIDEO_DIMENSIONS,
100 98
         height,
@@ -109,7 +107,7 @@ export function setLargeVideoDimensions(height, width) {
109 107
  * @private
110 108
  * @returns {(Track|undefined)}
111 109
  */
112
-function _electLastVisibleRemoteVideo(tracks) {
110
+function _electLastVisibleRemoteVideo(tracks: ITrack[]) {
113 111
     // First we try to get most recent remote video track.
114 112
     for (let i = tracks.length - 1; i >= 0; --i) {
115 113
         const track = tracks[i];
@@ -129,7 +127,7 @@ function _electLastVisibleRemoteVideo(tracks) {
129 127
  * @private
130 128
  * @returns {(string|undefined)}
131 129
  */
132
-function _electParticipantInLargeVideo(state) {
130
+function _electParticipantInLargeVideo(state: IReduxState) {
133 131
     // If a participant is pinned, they will be shown in the LargeVideo (regardless of whether they are local or
134 132
     // remote) when the filmstrip on stage is disabled.
135 133
     let participant = getPinnedParticipant(state);

react/features/large-video/actions.native.js → react/features/large-video/actions.native.ts View File

@@ -1,3 +1 @@
1
-// @flow
2
-
3 1
 export * from './actions.any';

react/features/large-video/actions.web.js → react/features/large-video/actions.web.ts View File

@@ -1,10 +1,8 @@
1
-// @flow
2
-
3
-import type { Dispatch } from 'redux';
4
-
1
+// @ts-expect-error
5 2
 import VideoLayout from '../../../modules/UI/videolayout/VideoLayout';
6
-import { MEDIA_TYPE } from '../base/media';
7
-import { getTrackByMediaTypeAndParticipant } from '../base/tracks';
3
+import { IStore } from '../app/types';
4
+import { MEDIA_TYPE } from '../base/media/constants';
5
+import { getTrackByMediaTypeAndParticipant } from '../base/tracks/functions.web';
8 6
 
9 7
 import { SET_SEE_WHAT_IS_BEING_SHARED, UPDATE_LAST_LARGE_VIDEO_MEDIA_EVENT } from './actionTypes';
10 8
 
@@ -16,7 +14,7 @@ export * from './actions.any';
16 14
 * @returns {Function}
17 15
 */
18 16
 export function captureLargeVideoScreenshot() {
19
-    return (dispatch: Dispatch<any>, getState: Function): Promise<string> => {
17
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
20 18
         const state = getState();
21 19
         const largeVideo = state['features/large-video'];
22 20
         const promise = Promise.resolve();
@@ -28,7 +26,7 @@ export function captureLargeVideoScreenshot() {
28 26
         const participantTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, largeVideo.participantId);
29 27
 
30 28
         // Participants that join the call video muted do not have a jitsiTrack attached.
31
-        if (!(participantTrack && participantTrack.jitsiTrack)) {
29
+        if (!participantTrack?.jitsiTrack) {
32 30
             return promise;
33 31
         }
34 32
         const videoStream = participantTrack.jitsiTrack.getOriginalStream();
@@ -39,7 +37,7 @@ export function captureLargeVideoScreenshot() {
39 37
 
40 38
         // Get the video element for the large video, cast HTMLElement to HTMLVideoElement to make flow happy.
41 39
         /* eslint-disable-next-line no-extra-parens*/
42
-        const videoElement = ((document.getElementById('largeVideo'): any): HTMLVideoElement);
40
+        const videoElement = (document.getElementById('largeVideo') as any);
43 41
 
44 42
         if (!videoElement) {
45 43
             return promise;
@@ -54,11 +52,11 @@ export function captureLargeVideoScreenshot() {
54 52
         canvasElement.style.display = 'none';
55 53
         canvasElement.height = parseInt(height, 10);
56 54
         canvasElement.width = parseInt(width, 10);
57
-        ctx.drawImage(videoElement, 0, 0);
55
+        ctx?.drawImage(videoElement, 0, 0);
58 56
         const dataURL = canvasElement.toDataURL('image/png', 1.0);
59 57
 
60 58
         // Cleanup.
61
-        ctx.clearRect(0, 0, canvasElement.width, canvasElement.height);
59
+        ctx?.clearRect(0, 0, canvasElement.width, canvasElement.height);
62 60
         canvasElement.remove();
63 61
 
64 62
         return Promise.resolve(dataURL);
@@ -73,7 +71,7 @@ export function captureLargeVideoScreenshot() {
73 71
  * @returns {Function}
74 72
  */
75 73
 export function resizeLargeVideo(width: number, height: number) {
76
-    return (dispatch: Dispatch<any>, getState: Function) => {
74
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
77 75
         const state = getState();
78 76
         const largeVideo = state['features/large-video'];
79 77
 

+ 0
- 15
react/features/large-video/functions.js View File

@@ -1,15 +0,0 @@
1
-// @flow
2
-
3
-import { getParticipantById } from '../base/participants';
4
-
5
-/**
6
- * Selector for the participant currently displaying on the large video.
7
- *
8
- * @param {Object} state - The redux state.
9
- * @returns {Object}
10
- */
11
-export function getLargeVideoParticipant(state: Object) {
12
-    const { participantId } = state['features/large-video'];
13
-
14
-    return getParticipantById(state, participantId);
15
-}

+ 14
- 0
react/features/large-video/functions.ts View File

@@ -0,0 +1,14 @@
1
+import { IReduxState } from '../app/types';
2
+import { getParticipantById } from '../base/participants/functions';
3
+
4
+/**
5
+ * Selector for the participant currently displaying on the large video.
6
+ *
7
+ * @param {Object} state - The redux state.
8
+ * @returns {Object}
9
+ */
10
+export function getLargeVideoParticipant(state: IReduxState) {
11
+    const { participantId } = state['features/large-video'];
12
+
13
+    return getParticipantById(state, participantId ?? '');
14
+}

react/features/large-video/logger.js → react/features/large-video/logger.ts View File

@@ -1,5 +1,3 @@
1
-// @flow
2
-
3 1
 import { getLogger } from '../base/logging/functions';
4 2
 
5 3
 export default getLogger('features/large-video');

react/features/large-video/middleware.js → react/features/large-video/middleware.ts View File

@@ -1,19 +1,16 @@
1
-// @flow
2
-
3 1
 import {
4 2
     DOMINANT_SPEAKER_CHANGED,
5 3
     PARTICIPANT_JOINED,
6 4
     PARTICIPANT_LEFT,
7
-    PIN_PARTICIPANT,
8
-    getDominantSpeakerParticipant,
9
-    getLocalParticipant
10
-} from '../base/participants';
11
-import { MiddlewareRegistry } from '../base/redux';
12
-import { isTestModeEnabled } from '../base/testing';
5
+    PIN_PARTICIPANT
6
+} from '../base/participants/actionTypes';
7
+import { getDominantSpeakerParticipant, getLocalParticipant } from '../base/participants/functions';
8
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
9
+import { isTestModeEnabled } from '../base/testing/functions';
13 10
 import {
14 11
     TRACK_ADDED,
15 12
     TRACK_REMOVED
16
-} from '../base/tracks';
13
+} from '../base/tracks/actionTypes';
17 14
 import { TOGGLE_DOCUMENT_EDITING } from '../etherpad/actionTypes';
18 15
 
19 16
 import { selectParticipantInLargeVideo } from './actions';

react/features/large-video/subscriber.native.js → react/features/large-video/subscriber.native.ts View File


react/features/large-video/subscriber.web.js → react/features/large-video/subscriber.web.ts View File

@@ -1,8 +1,7 @@
1
-// @flow
2
-
1
+// @ts-expect-error
3 2
 import VideoLayout from '../../../modules/UI/videolayout/VideoLayout';
4
-import { StateListenerRegistry } from '../base/redux';
5
-import { getVideoTrackByParticipant } from '../base/tracks';
3
+import StateListenerRegistry from '../base/redux/StateListenerRegistry';
4
+import { getVideoTrackByParticipant } from '../base/tracks/functions.web';
6 5
 
7 6
 import { getLargeVideoParticipant } from './functions';
8 7
 
@@ -29,7 +28,7 @@ StateListenerRegistry.register(
29 28
             streamingStatus: videoTrack?.streamingStatus
30 29
         };
31 30
     },
32
-    /* listener */ ({ participantId, streamingStatus }, previousState = {}) => {
31
+    /* listener */ ({ participantId, streamingStatus }, previousState: any = {}) => {
33 32
         if (streamingStatus !== previousState.streamingStatus) {
34 33
             VideoLayout.updateLargeVideo(participantId, true);
35 34
         }

react/features/lobby/actions.any.js → react/features/lobby/actions.any.ts View File

@@ -1,19 +1,13 @@
1
-// @flow
2
-
3
-import { type Dispatch } from 'redux';
4
-
5
-import {
6
-    conferenceWillJoin,
7
-    getCurrentConference,
8
-    sendLocalParticipant,
9
-    setPassword
10
-} from '../base/conference';
11
-import { getLocalParticipant } from '../base/participants';
1
+import { IStore } from '../app/types';
2
+import { conferenceWillJoin, setPassword } from '../base/conference/actions';
3
+import { getCurrentConference, sendLocalParticipant } from '../base/conference/functions';
4
+import { getLocalParticipant } from '../base/participants/functions';
5
+import { IParticipant } from '../base/participants/types';
12 6
 import { onLobbyChatInitialized, removeLobbyChatParticipant, sendMessage } from '../chat/actions.any';
13 7
 import { LOBBY_CHAT_MESSAGE } from '../chat/constants';
14 8
 import { handleLobbyMessageReceived } from '../chat/middleware';
15
-import { LOBBY_NOTIFICATION_ID, hideNotification } from '../notifications';
16
-import { showNotification } from '../notifications/actions';
9
+import { hideNotification, showNotification } from '../notifications/actions';
10
+import { LOBBY_NOTIFICATION_ID } from '../notifications/constants';
17 11
 
18 12
 import {
19 13
     KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED,
@@ -27,6 +21,7 @@ import {
27 21
 } from './actionTypes';
28 22
 import { LOBBY_CHAT_INITIALIZED, MODERATOR_IN_CHAT_WITH_LEFT } from './constants';
29 23
 import { getKnockingParticipants, getLobbyEnabled } from './functions';
24
+import { IKnockingParticipant } from './types';
30 25
 
31 26
 /**
32 27
  * Tries to join with a preset password.
@@ -35,7 +30,7 @@ import { getKnockingParticipants, getLobbyEnabled } from './functions';
35 30
  * @returns {Function}
36 31
  */
37 32
 export function joinWithPassword(password: string) {
38
-    return async (dispatch: Dispatch<any>, getState: Function) => {
33
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
39 34
         const conference = getCurrentConference(getState);
40 35
 
41 36
         dispatch(setPassword(conference, conference.join, password));
@@ -67,7 +62,7 @@ export function knockingParticipantLeft(id: string) {
67 62
  *     type: KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED
68 63
  * }}
69 64
  */
70
-export function participantIsKnockingOrUpdated(participant: Object) {
65
+export function participantIsKnockingOrUpdated(participant: IKnockingParticipant | Object) {
71 66
     return {
72 67
         participant,
73 68
         type: KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED
@@ -82,7 +77,7 @@ export function participantIsKnockingOrUpdated(participant: Object) {
82 77
  * @returns {Function}
83 78
  */
84 79
 export function answerKnockingParticipant(id: string, approved: boolean) {
85
-    return async (dispatch: Dispatch<any>) => {
80
+    return async (dispatch: IStore['dispatch']) => {
86 81
         dispatch(setKnockingParticipantApproval(id, approved));
87 82
         dispatch(hideNotification(LOBBY_NOTIFICATION_ID));
88 83
     };
@@ -96,7 +91,7 @@ export function answerKnockingParticipant(id: string, approved: boolean) {
96 91
  * @returns {Function}
97 92
  */
98 93
 export function setKnockingParticipantApproval(id: string, approved: boolean) {
99
-    return async (dispatch: Dispatch<any>, getState: Function) => {
94
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
100 95
         const conference = getCurrentConference(getState);
101 96
 
102 97
         if (conference) {
@@ -115,8 +110,8 @@ export function setKnockingParticipantApproval(id: string, approved: boolean) {
115 110
  * @param {Array<Object>} participants - A list of knocking participants.
116 111
  * @returns {void}
117 112
  */
118
-export function admitMultiple(participants: Array<Object>) {
119
-    return (dispatch: Function, getState: Function) => {
113
+export function admitMultiple(participants: Array<IKnockingParticipant>) {
114
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
120 115
         const conference = getCurrentConference(getState);
121 116
 
122 117
         participants.forEach(p => {
@@ -132,10 +127,10 @@ export function admitMultiple(participants: Array<Object>) {
132 127
  * @returns {Function}
133 128
  */
134 129
 export function approveKnockingParticipant(id: string) {
135
-    return (dispatch: Dispatch<any>, getState: Function) => {
130
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
136 131
         const conference = getCurrentConference(getState);
137 132
 
138
-        conference && conference.lobbyApproveAccess(id);
133
+        conference?.lobbyApproveAccess(id);
139 134
     };
140 135
 }
141 136
 
@@ -146,10 +141,10 @@ export function approveKnockingParticipant(id: string) {
146 141
  * @returns {Function}
147 142
  */
148 143
 export function rejectKnockingParticipant(id: string) {
149
-    return (dispatch: Dispatch<any>, getState: Function) => {
144
+    return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
150 145
         const conference = getCurrentConference(getState);
151 146
 
152
-        conference && conference.lobbyDenyAccess(id);
147
+        conference?.lobbyDenyAccess(id);
153 148
     };
154 149
 }
155 150
 
@@ -207,18 +202,20 @@ export function setPasswordJoinFailed(failed: boolean) {
207 202
  * @returns {Function}
208 203
  */
209 204
 export function startKnocking() {
210
-    return async (dispatch: Dispatch<any>, getState: Function) => {
205
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
211 206
         const state = getState();
212 207
         const { membersOnly } = state['features/base/conference'];
213 208
         const localParticipant = getLocalParticipant(state);
214 209
 
210
+        // @ts-ignore
215 211
         dispatch(conferenceWillJoin(membersOnly));
216 212
 
217 213
         // We need to update the conference object with the current display name, if approved
218 214
         // we want to send that display name, it was not updated in case when pre-join is disabled
215
+        // @ts-ignore
219 216
         sendLocalParticipant(state, membersOnly);
220 217
 
221
-        membersOnly.joinLobby(localParticipant.name, localParticipant.email);
218
+        membersOnly?.joinLobby(localParticipant?.name, localParticipant?.email);
222 219
         dispatch(setLobbyMessageListener());
223 220
         dispatch(setKnockingState(true));
224 221
     };
@@ -231,7 +228,7 @@ export function startKnocking() {
231 228
  * @returns {Function}
232 229
  */
233 230
 export function toggleLobbyMode(enabled: boolean) {
234
-    return async (dispatch: Dispatch<any>, getState: Function) => {
231
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
235 232
         const conference = getCurrentConference(getState);
236 233
 
237 234
         if (enabled) {
@@ -275,8 +272,8 @@ export function hideLobbyScreen() {
275 272
  *
276 273
  * @returns {Promise<void>}
277 274
  */
278
-export function handleLobbyChatInitialized(payload: Object) {
279
-    return async (dispatch: Dispatch<any>, getState: Function) => {
275
+export function handleLobbyChatInitialized(payload: { attendee: IParticipant; moderator: IParticipant; }) {
276
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
280 277
         const state = getState();
281 278
         const conference = getCurrentConference(state);
282 279
 
@@ -296,8 +293,8 @@ export function handleLobbyChatInitialized(payload: Object) {
296 293
             dispatch(showNotification({
297 294
                 titleKey: 'lobby.lobbyChatStartedNotification',
298 295
                 titleArguments: {
299
-                    moderator: payload.moderator.name,
300
-                    attendee: payload.attendee.name
296
+                    moderator: payload.moderator.name ?? '',
297
+                    attendee: payload.attendee.name ?? ''
301 298
                 }
302 299
             }));
303 300
         }
@@ -312,7 +309,7 @@ export function handleLobbyChatInitialized(payload: Object) {
312 309
  * @returns {Promise<void>}
313 310
  */
314 311
 export function onSendMessage(message: string) {
315
-    return async (dispatch: Dispatch<any>) => {
312
+    return async (dispatch: IStore['dispatch']) => {
316 313
         dispatch(sendMessage(message));
317 314
     };
318 315
 }
@@ -325,7 +322,7 @@ export function onSendMessage(message: string) {
325 322
  * @returns {Promise<void>}
326 323
  */
327 324
 export function sendLobbyChatMessage(message: Object) {
328
-    return async (dispatch: Dispatch<any>, getState: Function) => {
325
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
329 326
         const conference = getCurrentConference(getState);
330 327
 
331 328
         conference.sendLobbyMessage(message);
@@ -338,7 +335,7 @@ export function sendLobbyChatMessage(message: Object) {
338 335
  * @returns {Function}
339 336
  */
340 337
 export function maybeSetLobbyChatMessageListener() {
341
-    return async (dispatch: Dispatch<any>, getState: Function) => {
338
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
342 339
         const state = getState();
343 340
         const lobbyEnabled = getLobbyEnabled(state);
344 341
 
@@ -355,7 +352,7 @@ export function maybeSetLobbyChatMessageListener() {
355 352
  * @returns {Function}
356 353
  */
357 354
 export function updateLobbyParticipantOnLeave(participantId: string) {
358
-    return async (dispatch: Dispatch<any>, getState: Function) => {
355
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
359 356
         const state = getState();
360 357
         const { knocking, knockingParticipants } = state['features/lobby'];
361 358
         const { lobbyMessageRecipient } = state['features/chat'];
@@ -370,7 +367,7 @@ export function updateLobbyParticipantOnLeave(participantId: string) {
370 367
             const participantToNotify = knockingParticipants.find(p => p.chattingWithModerator === participantId);
371 368
 
372 369
             if (participantToNotify) {
373
-                conference.sendLobbyMessage({
370
+                conference?.sendLobbyMessage({
374 371
                     type: MODERATOR_IN_CHAT_WITH_LEFT,
375 372
                     moderatorId: participantToNotify.chattingWithModerator
376 373
                 }, participantToNotify.id);
@@ -389,7 +386,7 @@ export function updateLobbyParticipantOnLeave(participantId: string) {
389 386
  * @returns {Function}
390 387
  */
391 388
 export function setLobbyMessageListener() {
392
-    return async (dispatch: Dispatch<any>, getState: Function) => {
389
+    return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
393 390
         const state = getState();
394 391
         const conference = getCurrentConference(state);
395 392
         const { enableLobbyChat = true } = state['features/base/config'];
@@ -398,7 +395,7 @@ export function setLobbyMessageListener() {
398 395
             return;
399 396
         }
400 397
 
401
-        conference.addLobbyMessageListener((message: Object, participantId: string) => {
398
+        conference.addLobbyMessageListener((message: any, participantId: string) => {
402 399
             if (message.type === LOBBY_CHAT_MESSAGE) {
403 400
                 return dispatch(handleLobbyMessageReceived(message.message, participantId));
404 401
             }

react/features/lobby/actions.native.js → react/features/lobby/actions.native.ts View File

@@ -1,6 +1,7 @@
1 1
 import { batch } from 'react-redux';
2 2
 
3
-import { appNavigate } from '../app/actions';
3
+import { appNavigate } from '../app/actions.native';
4
+import { IStore } from '../app/types';
4 5
 
5 6
 import { hideLobbyScreen, setKnockingState } from './actions.any';
6 7
 
@@ -12,7 +13,7 @@ export * from './actions.any';
12 13
  * @returns {Function}
13 14
  */
14 15
 export function cancelKnocking() {
15
-    return dispatch => {
16
+    return (dispatch: IStore['dispatch']) => {
16 17
         batch(() => {
17 18
             dispatch(setKnockingState(false));
18 19
             dispatch(hideLobbyScreen());

react/features/lobby/actions.web.js → react/features/lobby/actions.web.ts View File

@@ -1,20 +1,15 @@
1
-// @flow
2
-
3
-import { type Dispatch } from 'redux';
4
-
5
-import { maybeRedirectToWelcomePage } from '../app/actions';
1
+import { maybeRedirectToWelcomePage } from '../app/actions.web';
2
+import { IStore } from '../app/types';
6 3
 
7 4
 export * from './actions.any';
8 5
 
9
-declare var APP: Object;
10
-
11 6
 /**
12 7
  * Cancels the ongoing knocking and abandons the join flow.
13 8
  *
14 9
  * @returns {Function}
15 10
  */
16 11
 export function cancelKnocking() {
17
-    return async (dispatch: Dispatch<any>) => {
12
+    return async (dispatch: IStore['dispatch']) => {
18 13
         // when we are redirecting the library should handle any
19 14
         // unload and clean of the connection.
20 15
         APP.API.notifyReadyToClose();

react/features/lobby/functions.js → react/features/lobby/functions.ts View File

@@ -1,44 +1,46 @@
1
-// @flow
1
+import { IReduxState } from '../app/types';
2
+import { getCurrentConference } from '../base/conference/functions';
3
+
4
+import { IKnockingParticipant } from './types';
2 5
 
3
-import { getCurrentConference } from '../base/conference';
4 6
 
5 7
 /**
6 8
 * Selector to return lobby enable state.
7 9
 *
8
-* @param {any} state - State object.
10
+* @param {IReduxState} state - State object.
9 11
 * @returns {boolean}
10 12
 */
11
-export function getLobbyEnabled(state: any) {
13
+export function getLobbyEnabled(state: IReduxState) {
12 14
     return state['features/lobby'].lobbyEnabled;
13 15
 }
14 16
 
15 17
 /**
16 18
 * Selector to return a list of knocking participants.
17 19
 *
18
-* @param {any} state - State object.
20
+* @param {IReduxState} state - State object.
19 21
 * @returns {Array<Object>}
20 22
 */
21
-export function getKnockingParticipants(state: any) {
23
+export function getKnockingParticipants(state: IReduxState) {
22 24
     return state['features/lobby'].knockingParticipants;
23 25
 }
24 26
 
25 27
 /**
26 28
  * Selector to return lobby visibility.
27 29
  *
28
- * @param {any} state - State object.
30
+ * @param {IReduxState} state - State object.
29 31
  * @returns {any}
30 32
  */
31
-export function getIsLobbyVisible(state: any) {
33
+export function getIsLobbyVisible(state: IReduxState) {
32 34
     return state['features/lobby'].lobbyVisible;
33 35
 }
34 36
 
35 37
 /**
36 38
  * Selector to return array with knocking participant ids.
37 39
  *
38
- * @param {any} state - State object.
40
+ * @param {IReduxState} state - State object.
39 41
  * @returns {Array}
40 42
  */
41
-export function getKnockingParticipantsById(state: any) {
43
+export function getKnockingParticipantsById(state: IReduxState) {
42 44
     return getKnockingParticipants(state).map(participant => participant.id);
43 45
 }
44 46
 
@@ -50,9 +52,9 @@ export function getKnockingParticipantsById(state: any) {
50 52
  * @returns {Function}
51 53
  */
52 54
 export function showLobbyChatButton(
53
-        participant: Object
55
+        participant: IKnockingParticipant
54 56
 ) {
55
-    return function(state: Object) {
57
+    return function(state: IReduxState) {
56 58
 
57 59
         const { enableLobbyChat = true } = state['features/base/config'];
58 60
         const { lobbyMessageRecipient, isLobbyChatActive } = state['features/chat'];

react/features/lobby/logger.js → react/features/lobby/logger.ts View File

@@ -1,5 +1,3 @@
1
-// @flow
2
-
3 1
 import { getLogger } from '../base/logging/functions';
4 2
 
5 3
 export default getLogger('features/lobby');

react/features/lobby/middleware.js → react/features/lobby/middleware.ts View File

@@ -1,39 +1,41 @@
1
-// @flow
2
-
3 1
 import i18n from 'i18next';
4 2
 import { batch } from 'react-redux';
3
+import { AnyAction } from 'redux';
5 4
 
6
-import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
7
-import {
8
-    CONFERENCE_FAILED,
9
-    CONFERENCE_JOINED,
10
-    conferenceWillJoin
11
-} from '../base/conference';
5
+import { IStore } from '../app/types';
6
+import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app/actionTypes';
7
+import { CONFERENCE_FAILED, CONFERENCE_JOINED } from '../base/conference/actionTypes';
8
+import { conferenceWillJoin } from '../base/conference/actions';
12 9
 import { JitsiConferenceErrors, JitsiConferenceEvents } from '../base/lib-jitsi-meet';
13
-import { getFirstLoadableAvatarUrl, getParticipantDisplayName } from '../base/participants';
14
-import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';
15
-import { playSound, registerSound, unregisterSound } from '../base/sounds';
16
-import { isTestModeEnabled } from '../base/testing';
10
+import { getFirstLoadableAvatarUrl, getParticipantDisplayName } from '../base/participants/functions';
11
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
12
+import StateListenerRegistry from '../base/redux/StateListenerRegistry';
13
+import { playSound, registerSound, unregisterSound } from '../base/sounds/actions';
14
+import { isTestModeEnabled } from '../base/testing/functions';
17 15
 import { handleLobbyChatInitialized, removeLobbyChatParticipant } from '../chat/actions.any';
18
-import { approveKnockingParticipant, rejectKnockingParticipant } from '../lobby/actions';
16
+import {
17
+    hideNotification,
18
+    showNotification
19
+} from '../notifications/actions';
19 20
 import {
20 21
     LOBBY_NOTIFICATION_ID,
21 22
     NOTIFICATION_ICON,
22 23
     NOTIFICATION_TIMEOUT_TYPE,
23
-    NOTIFICATION_TYPE,
24
-    hideNotification,
25
-    showNotification
26
-} from '../notifications';
24
+    NOTIFICATION_TYPE
25
+} from '../notifications/constants';
26
+import { INotificationProps } from '../notifications/types';
27 27
 import { open as openParticipantsPane } from '../participants-pane/actions';
28 28
 import { getParticipantsPaneOpen } from '../participants-pane/functions';
29 29
 import { shouldAutoKnock } from '../prejoin/functions';
30 30
 
31 31
 import { KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED, KNOCKING_PARTICIPANT_LEFT } from './actionTypes';
32 32
 import {
33
+    approveKnockingParticipant,
33 34
     hideLobbyScreen,
34 35
     knockingParticipantLeft,
35 36
     openLobbyScreen,
36 37
     participantIsKnockingOrUpdated,
38
+    rejectKnockingParticipant,
37 39
     setLobbyMessageListener,
38 40
     setLobbyModeEnabled,
39 41
     setPasswordJoinFailed,
@@ -43,8 +45,7 @@ import { updateLobbyParticipantOnLeave } from './actions.any';
43 45
 import { KNOCKING_PARTICIPANT_SOUND_ID } from './constants';
44 46
 import { getKnockingParticipants, showLobbyChatButton } from './functions';
45 47
 import { KNOCKING_PARTICIPANT_FILE } from './sounds';
46
-
47
-declare var APP: Object;
48
+import { IKnockingParticipant } from './types';
48 49
 
49 50
 MiddlewareRegistry.register(store => next => action => {
50 51
     switch (action.type) {
@@ -88,14 +89,14 @@ StateListenerRegistry.register(
88 89
     state => state['features/base/conference'].conference,
89 90
     (conference, { dispatch, getState }, previousConference) => {
90 91
         if (conference && !previousConference) {
91
-            conference.on(JitsiConferenceEvents.MEMBERS_ONLY_CHANGED, enabled => {
92
+            conference.on(JitsiConferenceEvents.MEMBERS_ONLY_CHANGED, (enabled: boolean) => {
92 93
                 dispatch(setLobbyModeEnabled(enabled));
93 94
                 if (enabled) {
94 95
                     dispatch(setLobbyMessageListener());
95 96
                 }
96 97
             });
97 98
 
98
-            conference.on(JitsiConferenceEvents.LOBBY_USER_JOINED, (id, name) => {
99
+            conference.on(JitsiConferenceEvents.LOBBY_USER_JOINED, (id: string, name: string) => {
99 100
                 const { soundsParticipantKnocking } = getState()['features/base/settings'];
100 101
 
101 102
                 batch(() => {
@@ -180,7 +181,7 @@ StateListenerRegistry.register(
180 181
                 });
181 182
             });
182 183
 
183
-            conference.on(JitsiConferenceEvents.LOBBY_USER_UPDATED, (id, participant) => {
184
+            conference.on(JitsiConferenceEvents.LOBBY_USER_UPDATED, (id: string, participant: IKnockingParticipant) => {
184 185
                 dispatch(
185 186
                     participantIsKnockingOrUpdated({
186 187
                         ...participant,
@@ -189,7 +190,7 @@ StateListenerRegistry.register(
189 190
                 );
190 191
             });
191 192
 
192
-            conference.on(JitsiConferenceEvents.LOBBY_USER_LEFT, id => {
193
+            conference.on(JitsiConferenceEvents.LOBBY_USER_LEFT, (id: string) => {
193 194
                 batch(() => {
194 195
                     dispatch(knockingParticipantLeft(id));
195 196
                     dispatch(removeLobbyChatParticipant());
@@ -197,7 +198,7 @@ StateListenerRegistry.register(
197 198
                 });
198 199
             });
199 200
 
200
-            conference.on(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, (origin, sender) =>
201
+            conference.on(JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED, (origin: any, sender: any) =>
201 202
                 _maybeSendLobbyNotification(origin, sender, {
202 203
                     dispatch,
203 204
                     getState
@@ -213,7 +214,7 @@ StateListenerRegistry.register(
213 214
  * @param {Object} store - The Redux store.
214 215
  * @returns {void}
215 216
  */
216
-function _handleLobbyNotification(store) {
217
+function _handleLobbyNotification(store: IStore) {
217 218
     const { dispatch, getState } = store;
218 219
     const knockingParticipants = getKnockingParticipants(getState());
219 220
 
@@ -275,7 +276,7 @@ function _handleLobbyNotification(store) {
275 276
  * @param {Object} action - The Redux action.
276 277
  * @returns {Object}
277 278
  */
278
-function _conferenceFailed({ dispatch, getState }, next, action) {
279
+function _conferenceFailed({ dispatch, getState }: IStore, next: Function, action: AnyAction) {
279 280
     const { error } = action;
280 281
     const state = getState();
281 282
     const { membersOnly } = state['features/base/conference'];
@@ -296,6 +297,7 @@ function _conferenceFailed({ dispatch, getState }, next, action) {
296 297
 
297 298
         // In case of wrong password we need to be in the right state if in the meantime someone allows us to join
298 299
         if (nonFirstFailure) {
300
+            // @ts-ignore
299 301
             dispatch(conferenceWillJoin(membersOnly));
300 302
         }
301 303
 
@@ -328,7 +330,7 @@ function _conferenceFailed({ dispatch, getState }, next, action) {
328 330
  * @param {Object} action - The Redux action.
329 331
  * @returns {Object}
330 332
  */
331
-function _conferenceJoined({ dispatch }, next, action) {
333
+function _conferenceJoined({ dispatch }: IStore, next: Function, action: AnyAction) {
332 334
     dispatch(hideLobbyScreen());
333 335
 
334 336
     return next(action);
@@ -341,13 +343,13 @@ function _conferenceJoined({ dispatch }, next, action) {
341 343
  * @param {Object} participant - The knocking participant.
342 344
  * @returns {void}
343 345
  */
344
-function _findLoadableAvatarForKnockingParticipant(store, { id }) {
346
+function _findLoadableAvatarForKnockingParticipant(store: IStore, { id }: { id: string; }) {
345 347
     const { dispatch, getState } = store;
346 348
     const updatedParticipant = getState()['features/lobby'].knockingParticipants.find(p => p.id === id);
347 349
     const { disableThirdPartyRequests } = getState()['features/base/config'];
348 350
 
349 351
     if (!disableThirdPartyRequests && updatedParticipant && !updatedParticipant.loadableAvatarUrl) {
350
-        getFirstLoadableAvatarUrl(updatedParticipant, store).then(result => {
352
+        getFirstLoadableAvatarUrl(updatedParticipant, store).then((result: { isUsingCORS: boolean; src: string; }) => {
351 353
             if (result) {
352 354
                 const { isUsingCORS, src } = result;
353 355
 
@@ -372,12 +374,12 @@ function _findLoadableAvatarForKnockingParticipant(store, { id }) {
372 374
  * @param {Object} store - The Redux store.
373 375
  * @returns {void}
374 376
  */
375
-function _maybeSendLobbyNotification(origin, message, { dispatch, getState }) {
377
+function _maybeSendLobbyNotification(origin: any, message: any, { dispatch, getState }: IStore) {
376 378
     if (!origin?._id || message?.type !== 'lobby-notify') {
377 379
         return;
378 380
     }
379 381
 
380
-    const notificationProps: any = {
382
+    const notificationProps: INotificationProps = {
381 383
         descriptionArguments: {
382 384
             originParticipantName: getParticipantDisplayName(getState, origin._id),
383 385
             targetParticipantName: message.name

+ 1
- 5
react/features/lobby/reducer.ts View File

@@ -1,5 +1,4 @@
1 1
 import { CONFERENCE_JOINED, CONFERENCE_LEFT, SET_PASSWORD } from '../base/conference/actionTypes';
2
-import { IParticipant } from '../base/participants/types';
3 2
 import ReducerRegistry from '../base/redux/ReducerRegistry';
4 3
 
5 4
 import {
@@ -12,6 +11,7 @@ import {
12 11
     SET_LOBBY_VISIBILITY,
13 12
     SET_PASSWORD_JOIN_FAILED
14 13
 } from './actionTypes';
14
+import { IKnockingParticipant } from './types';
15 15
 
16 16
 const DEFAULT_STATE = {
17 17
     knocking: false,
@@ -21,10 +21,6 @@ const DEFAULT_STATE = {
21 21
     passwordJoinFailed: false
22 22
 };
23 23
 
24
-interface IKnockingParticipant extends IParticipant {
25
-    chattingWithModerator?: string;
26
-}
27
-
28 24
 export interface ILobbyState {
29 25
     knocking: boolean;
30 26
     knockingParticipants: IKnockingParticipant[];

react/features/lobby/sounds.js → react/features/lobby/sounds.ts View File


+ 5
- 0
react/features/lobby/types.ts View File

@@ -0,0 +1,5 @@
1
+import { IParticipant } from '../base/participants/types';
2
+
3
+export interface IKnockingParticipant extends IParticipant {
4
+    chattingWithModerator?: string;
5
+}

react/features/old-client-notification/functions.js → react/features/old-client-notification/functions.ts View File

@@ -1,6 +1,4 @@
1
-// @flow
2
-
3
-import { browser } from '../../../react/features/base/lib-jitsi-meet';
1
+import { browser } from '../base/lib-jitsi-meet';
4 2
 
5 3
 /**
6 4
  * Returns true if Jitsi Meet is running in too old jitsi-meet-electron app and false otherwise.

react/features/old-client-notification/middleware.js → react/features/old-client-notification/middleware.tsx View File

@@ -1,16 +1,16 @@
1
-// @flow
2
-
3 1
 import React from 'react';
2
+import { AnyAction } from 'redux';
4 3
 
5
-import { APP_WILL_MOUNT } from '../base/app';
6
-import { MiddlewareRegistry } from '../base/redux';
7
-import { NOTIFICATION_TIMEOUT_TYPE, showErrorNotification } from '../notifications';
4
+import { IStore } from '../app/types';
5
+import { APP_WILL_MOUNT } from '../base/app/actionTypes';
6
+import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
7
+import { showErrorNotification } from '../notifications/actions';
8
+import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
8 9
 
10
+// @ts-ignore
9 11
 import { OldElectronAPPNotificationDescription } from './components';
10 12
 import { isOldJitsiMeetElectronApp } from './functions';
11 13
 
12
-declare var interfaceConfig: Object;
13
-
14 14
 MiddlewareRegistry.register(store => next => action => {
15 15
     switch (action.type) {
16 16
     case APP_WILL_MOUNT:
@@ -29,7 +29,7 @@ MiddlewareRegistry.register(store => next => action => {
29 29
  * @private
30 30
  * @returns {Object} The new state that is the result of the reduction of the specified {@code action}.
31 31
  */
32
-function _appWillMount(store, next, action) {
32
+function _appWillMount(store: IStore, next: Function, action: AnyAction) {
33 33
     if (isOldJitsiMeetElectronApp()) {
34 34
         const { dispatch } = store;
35 35
 

+ 1
- 3
react/features/participants-pane/components/web/LobbyParticipants.tsx View File

@@ -9,9 +9,7 @@ import { Avatar } from '../../../base/avatar';
9 9
 import Icon from '../../../base/icons/components/Icon';
10 10
 import { IconCheck, IconCloseLarge } from '../../../base/icons/svg';
11 11
 import { withPixelLineHeight } from '../../../base/styles/functions.web';
12
-// @ts-ignore
13 12
 import { admitMultiple } from '../../../lobby/actions.web';
14
-// @ts-ignore
15 13
 import { getKnockingParticipants, getLobbyEnabled } from '../../../lobby/functions';
16 14
 // @ts-ignore
17 15
 import { Drawer, JitsiPortal } from '../../../toolbox/components/web';
@@ -72,7 +70,7 @@ const useStyles = makeStyles()(theme => {
72 70
  */
73 71
 export default function LobbyParticipants() {
74 72
     const lobbyEnabled = useSelector(getLobbyEnabled);
75
-    const participants: Array<Object> = useSelector(getKnockingParticipants);
73
+    const participants = useSelector(getKnockingParticipants);
76 74
     const { t } = useTranslation();
77 75
     const { classes } = useStyles();
78 76
     const dispatch = useDispatch();

react/features/participants-pane/hooks.ts → react/features/participants-pane/hooks.web.ts View File

@@ -2,9 +2,7 @@ import { useCallback, useState } from 'react';
2 2
 import { useDispatch } from 'react-redux';
3 3
 
4 4
 import { handleLobbyChatInitialized } from '../chat/actions.any';
5
-// eslint-disable-next-line lines-around-comment
6
-// @ts-ignore
7
-import { approveKnockingParticipant, rejectKnockingParticipant } from '../lobby/actions';
5
+import { approveKnockingParticipant, rejectKnockingParticipant } from '../lobby/actions.web';
8 6
 
9 7
 interface IDrawerParticipant {
10 8
     displayName?: string;
@@ -24,12 +22,12 @@ export function useLobbyActions(participant?: IDrawerParticipant | null, closeDr
24 22
     return [
25 23
         useCallback(e => {
26 24
             e.stopPropagation();
27
-            dispatch(approveKnockingParticipant(participant?.participantID));
25
+            dispatch(approveKnockingParticipant(participant?.participantID ?? ''));
28 26
             closeDrawer?.();
29 27
         }, [ dispatch, closeDrawer ]),
30 28
 
31 29
         useCallback(() => {
32
-            dispatch(rejectKnockingParticipant(participant?.participantID));
30
+            dispatch(rejectKnockingParticipant(participant?.participantID ?? ''));
33 31
             closeDrawer?.();
34 32
         }, [ dispatch, closeDrawer ]),
35 33
 

+ 1
- 0
tsconfig.native.json View File

@@ -26,6 +26,7 @@
26 26
         "react/features/feedback",
27 27
         "react/features/no-audio-signal",
28 28
         "react/features/noise-suppression",
29
+        "react/features/old-client-notification",
29 30
         "react/features/screen-share",
30 31
         "react/features/stream-effects/noise-suppression",
31 32
         "react/features/stream-effects/rnnoise",

Loading…
Cancel
Save