ref(TS) Improve TS (#13120)

Remove unnecessary @ts-ignore
Fix some TS errors
pull/13127/head jitsi-meet_8477
Robert Pintilii 2 years ago committed by GitHub
parent b942ce9378
commit 29945f4809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      react/features/base/avatar/components/index.native.ts
  2. 6
      react/features/base/conference/actions.ts
  3. 2
      react/features/base/conference/functions.ts
  4. 27
      react/features/base/conference/reducer.ts
  5. 4
      react/features/base/dialog/components/native/PageReloadDialog.tsx
  6. 2
      react/features/base/dialog/logger.ts
  7. 2
      react/features/base/lib-jitsi-meet/functions.any.ts
  8. 6
      react/features/base/settings/components/native/SettingsButton.tsx
  9. 4
      react/features/base/tracks/actions.web.ts
  10. 3
      react/features/base/ui/components/web/ContextMenu.tsx
  11. 2
      react/features/breakout-rooms/actions.ts
  12. 3
      react/features/breakout-rooms/functions.ts
  13. 2
      react/features/chat/actions.any.ts
  14. 2
      react/features/chat/actions.native.ts
  15. 5
      react/features/chat/actions.web.ts
  16. 2
      react/features/chat/middleware.ts
  17. 10
      react/features/conference/components/native/LonelyMeetingExperience.tsx
  18. 8
      react/features/conference/middleware.ts
  19. 1
      react/features/deep-linking/components/DeepLinkingMobilePage.web.tsx
  20. 2
      react/features/desktop-picker/components/DesktopPicker.tsx
  21. 5
      react/features/face-landmarks/functions.ts
  22. 21
      react/features/filmstrip/actions.native.ts
  23. 6
      react/features/filmstrip/components/native/ModeratorIndicator.tsx
  24. 6
      react/features/filmstrip/components/web/ModeratorIndicator.tsx
  25. 2
      react/features/follow-me/middleware.ts
  26. 3
      react/features/invite/components/add-people-dialog/web/AddPeopleDialog.tsx
  27. 2
      react/features/invite/components/add-people-dialog/web/DialInNumber.tsx
  28. 2
      react/features/invite/components/add-people-dialog/web/DialInSection.tsx
  29. 6
      react/features/invite/components/dial-in-summary/web/ConferenceID.tsx
  30. 9
      react/features/invite/components/dial-in-summary/web/NumbersList.tsx
  31. 16
      react/features/lobby/actions.any.ts
  32. 7
      react/features/lobby/middleware.ts
  33. 1
      react/features/noise-suppression/actions.ts
  34. 3
      react/features/overlay/actions.native.ts
  35. 3
      react/features/overlay/middleware.ts
  36. 4
      react/features/participants-pane/components/native/MeetingParticipantList.tsx
  37. 4
      react/features/participants-pane/components/web/InviteButton.tsx
  38. 2
      react/features/prejoin/actions.web.ts
  39. 5
      react/features/prejoin/components/web/dialogs/DialInDialog.tsx
  40. 5
      react/features/prejoin/components/web/dialogs/DialOutDialog.tsx
  41. 2
      react/features/recent-list/reducer.ts
  42. 11
      react/features/recording/components/Recording/AbstractStartRecordingDialogContent.tsx
  43. 1
      react/features/recording/components/Recording/native/StartRecordingDialogContent.tsx
  44. 4
      react/features/recording/components/Recording/web/HighlightButton.tsx
  45. 6
      react/features/recording/components/web/RecordingLabel.tsx
  46. 2
      react/features/salesforce/useSalesforceLinkDialog.ts
  47. 4
      react/features/shared-video/middleware.any.ts
  48. 6
      react/features/speaker-stats/components/AbstractSpeakerStatsButton.tsx
  49. 2
      react/features/speaker-stats/components/web/SpeakerStatsButton.tsx
  50. 3
      react/features/speaker-stats/components/web/SpeakerStatsList.tsx
  51. 10
      react/features/toolbox/actions.native.ts
  52. 5
      react/features/toolbox/components/native/OpenCarmodeButton.tsx
  53. 3
      react/features/toolbox/components/native/ScreenSharingButton.tsx
  54. 3
      react/features/video-menu/components/web/ParticipantContextMenu.tsx
  55. 2
      react/features/virtual-background/components/VirtualBackgrounds.tsx
  56. 1
      react/features/welcome/constants.tsx
  57. 6
      react/features/whiteboard/middleware.ts

@ -1,3 +1,2 @@
// @ts-ignore
export { default as StatelessAvatar } from './native/StatelessAvatar';
export { default as Avatar } from './Avatar';

@ -384,7 +384,7 @@ export function conferenceJoinInProgress(conference: IJitsiConference) {
* conference: JitsiConference
* }}
*/
export function conferenceLeft(conference: Partial<IJitsiConference>) {
export function conferenceLeft(conference?: IJitsiConference) {
return {
type: CONFERENCE_LEFT,
conference
@ -473,7 +473,7 @@ export function _conferenceWillJoin(conference: IJitsiConference) {
* conference: JitsiConference
* }}
*/
export function conferenceWillJoin(conference: IJitsiConference) {
export function conferenceWillJoin(conference?: IJitsiConference) {
return {
type: CONFERENCE_WILL_JOIN,
conference
@ -493,7 +493,7 @@ export function conferenceWillJoin(conference: IJitsiConference) {
* conference: JitsiConference
* }}
*/
export function conferenceWillLeave(conference: IJitsiConference) {
export function conferenceWillLeave(conference?: IJitsiConference) {
return {
type: CONFERENCE_WILL_LEAVE,
conference

@ -339,7 +339,7 @@ export function getConferenceTimestamp(stateful: IStateful) {
* {@code getState} function.
* @returns {JitsiConference|undefined}
*/
export function getCurrentConference(stateful: IStateful): any {
export function getCurrentConference(stateful: IStateful): IJitsiConference | undefined {
const { conference, joining, leaving, membersOnly, passwordRequired }
= getConferenceState(toState(stateful));

@ -41,6 +41,7 @@ const DEFAULT_STATE = {
export interface IJitsiConference {
addCommandListener: Function;
addLobbyMessageListener: Function;
addTrack: Function;
authenticateAndUpgradeRole: Function;
avModerationApprove: Function;
@ -48,19 +49,25 @@ export interface IJitsiConference {
createVideoSIPGWSession: Function;
dial: Function;
disableAVModeration: Function;
disableLobby: Function;
enableAVModeration: Function;
enableLobby: Function;
end: Function;
getBreakoutRooms: Function;
getLocalParticipantProperty: Function;
getLocalTracks: Function;
getMeetingUniqueId: Function;
getMetadataHandler: Function;
getName: Function;
getParticipantById: Function;
getParticipants: Function;
getRole: Function;
getSpeakerStats: () => ISpeakerStats;
grantOwner: Function;
isAVModerationSupported: Function;
isCallstatsEnabled: Function;
isE2EEEnabled: Function;
isE2EESupported: Function;
isEndConferenceSupported: Function;
isLobbySupported: Function;
isSIPCallingSupported: Function;
@ -69,7 +76,11 @@ export interface IJitsiConference {
join: Function;
joinLobby: Function;
kickParticipant: Function;
leave: Function;
lobbyApproveAccess: Function;
lobbyDenyAccess: Function;
lock: Function;
markParticipantVerified: Function;
muteParticipant: Function;
myLobbyUserId: Function;
myUserId: Function;
@ -79,6 +90,7 @@ export interface IJitsiConference {
removeTrack: Function;
replaceTrack: Function;
room: IJitsiConferenceRoom;
sendApplicationLog: Function;
sendCommand: Function;
sendCommandOnce: Function;
sendEndpointMessage: Function;
@ -86,16 +98,21 @@ export interface IJitsiConference {
sendFeedback: Function;
sendLobbyMessage: Function;
sendMessage: Function;
sendPrivateTextMessage: Function;
sendTextMessage: Function;
sessionId: string;
setDesktopSharingFrameRate: Function;
setDisplayName: Function;
setLocalParticipantProperty: Function;
setMediaEncryptionKey: Function;
setReceiverConstraints: Function;
setSenderVideoConstraint: Function;
setStartMutedPolicy: Function;
setSubject: Function;
startRecording: Function;
startVerification: Function;
stopRecording: Function;
toggleE2EE: Function;
}
export interface IConferenceState {
@ -107,8 +124,8 @@ export interface IConferenceState {
e2eeSupported?: boolean;
error?: Error;
followMeEnabled?: boolean;
joining?: Object;
leaving?: Object;
joining?: IJitsiConference;
leaving?: IJitsiConference;
localSubject?: string;
locked?: string;
membersOnly?: IJitsiConference;
@ -116,7 +133,7 @@ export interface IConferenceState {
obfuscatedRoomSource?: string;
p2p?: Object;
password?: string;
passwordRequired?: Object;
passwordRequired?: IJitsiConference;
pendingSubjectChange?: string;
room?: string;
startAudioMutedPolicy?: boolean;
@ -348,7 +365,7 @@ function _conferenceJoined(state: IConferenceState, { conference }: { conference
* reduction of the specified action.
*/
function _conferenceLeftOrWillLeave(state: IConferenceState, { conference, type }:
{ conference: Object; type: string; }) {
{ conference: IJitsiConference; type: string; }) {
const nextState = { ...state };
// The redux action CONFERENCE_LEFT is the last time that we should be
@ -402,7 +419,7 @@ function _conferenceLeftOrWillLeave(state: IConferenceState, { conference, type
* @returns {Object} The new state of the feature base/conference after the
* reduction of the specified action.
*/
function _conferenceWillJoin(state: IConferenceState, { conference }: { conference: Object; }) {
function _conferenceWillJoin(state: IConferenceState, { conference }: { conference: IJitsiConference; }) {
return assign(state, {
error: undefined,
joining: conference

@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
// @ts-ignore
import { randomInt } from '@jitsi/js-utils/random';
import React, { Component } from 'react';
@ -11,7 +9,6 @@ import { IReduxState, IStore } from '../../../../app/types';
import { translate } from '../../../i18n/functions';
import { isFatalJitsiConnectionError } from '../../../lib-jitsi-meet/functions.native';
import { hideDialog } from '../../actions';
// @ts-ignore
import logger from '../../logger';
// @ts-ignore
@ -203,6 +200,7 @@ function mapStateToProps(state: IReduxState) {
const { fatalError } = state['features/overlay'];
const fatalConnectionError
// @ts-ignore
= connectionError && isFatalJitsiConnectionError(connectionError);
const fatalConfigError = fatalError === configError;

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

@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import { IStateful } from '../app/types';
import { toState } from '../redux/functions';

@ -5,8 +5,7 @@ import { connect } from 'react-redux';
import { IReduxState } from '../../../../app/types';
import { translate } from '../../../../base/i18n/functions';
import { IconGear } from '../../../../base/icons/svg';
// @ts-ignore
import { AbstractButton, type AbstractButtonProps } from '../../../../base/toolbox/components';
import AbstractButton, { IProps as AbstractButtonProps } from '../../../../base/toolbox/components/AbstractButton';
import { navigate }
// @ts-ignore
from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
@ -18,7 +17,7 @@ import { getFeatureFlag } from '../../../flags/functions';
/**
* Implements an {@link AbstractButton} to open the carmode.
*/
class SettingsButton extends AbstractButton<AbstractButtonProps, any, any> {
class SettingsButton extends AbstractButton<AbstractButtonProps> {
accessibilityLabel = 'toolbar.accessibilityLabel.Settings';
icon = IconGear;
label = 'settings.buttonLabel';
@ -49,5 +48,4 @@ function _mapStateToProps(state: IReduxState) {
};
}
// @ts-ignore
export default translate(connect(_mapStateToProps)(SettingsButton));

@ -120,7 +120,7 @@ async function _maybeApplyAudioMixerEffect(desktopAudioTrack: any, state: IRedux
} else {
// If no local stream is present ( i.e. no input audio devices) we use the screen share audio
// stream as we would use a regular stream.
await conference.replaceTrack(null, desktopAudioTrack);
await conference?.replaceTrack(null, desktopAudioTrack);
}
}
@ -250,7 +250,7 @@ async function _toggleScreenSharing(
if (localAudio) {
localAudio.setEffect(undefined);
} else {
await conference.replaceTrack(desktopAudioTrack, null);
await conference?.replaceTrack(desktopAudioTrack, null);
}
desktopAudioTrack.dispose();
dispatch(setScreenshareAudioTrack(null));

@ -197,8 +197,7 @@ const ContextMenu = ({
const { current: container } = containerRef;
// make sure the max height is not set
// @ts-ignore
container.style.maxHeight = null;
container.style.maxHeight = 'none';
const { offsetTop, offsetParent: { offsetHeight, scrollTop } } = offsetTarget;
let outerHeight = getComputedOuterHeight(container);
let height = Math.min(MAX_HEIGHT, outerHeight);

@ -207,7 +207,7 @@ export function moveToRoom(roomId?: string) {
dispatch(conferenceWillLeave(conference));
try {
await conference.leave(CONFERENCE_LEAVE_REASONS.SWITCH_ROOM);
await conference?.leave(CONFERENCE_LEAVE_REASONS.SWITCH_ROOM);
} catch (error) {
logger.warn('JitsiConference.leave() rejected with:', error);

@ -2,7 +2,6 @@ import _ from 'lodash';
import { IStateful } from '../base/app/types';
import { getCurrentConference } from '../base/conference/functions';
import { IJitsiConference } from '../base/conference/reducer';
import {
getLocalParticipant,
getParticipantById,
@ -46,7 +45,7 @@ export const getMainRoom = (stateful: IStateful) => {
*/
export const getRoomsInfo = (stateful: IStateful) => {
const breakoutRooms = getBreakoutRooms(stateful);
const conference: IJitsiConference = getCurrentConference(stateful);
const conference = getCurrentConference(stateful);
const initialRoomsInfo = {
rooms: []

@ -153,7 +153,7 @@ export function onLobbyChatInitialized(lobbyChatInitializedInfo: { attendee: IPa
const state = getState();
const conference = getCurrentConference(state);
const lobbyLocalId = conference.myLobbyUserId();
const lobbyLocalId = conference?.myLobbyUserId();
if (!lobbyLocalId) {
return;

@ -21,7 +21,7 @@ export * from './actions.any';
* type: OPEN_CHAT
* }}
*/
export function openChat(participant: Object, disablePolls: boolean) {
export function openChat(participant: Object, disablePolls?: boolean) {
if (disablePolls) {
navigate(screen.conference.chat);
}

@ -1,4 +1,4 @@
// @ts-ignore
// @ts-expect-error
import VideoLayout from '../../../modules/UI/videolayout/VideoLayout';
import { IStore } from '../app/types';
@ -11,12 +11,13 @@ export * from './actions.any';
* Displays the chat panel.
*
* @param {Object} participant - The recipient for the private chat.
* @param {Object} _disablePolls - Used on native.
* @returns {{
* participant: Participant,
* type: OPEN_CHAT
* }}
*/
export function openChat(participant?: Object) {
export function openChat(participant?: Object, _disablePolls?: boolean) {
return function(dispatch: IStore['dispatch']) {
dispatch({
participant,

@ -30,8 +30,6 @@ import { pushReactions } from '../reactions/actions.any';
import { ENDPOINT_REACTION_NAME } from '../reactions/constants';
import { getReactionMessageFromBuffer, isReactionsEnabled } from '../reactions/functions.any';
import { endpointMessageReceived } from '../subtitles/actions.any';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { showToolbox } from '../toolbox/actions';

@ -1,16 +1,14 @@
/* eslint-disable lines-around-comment */
import React, { PureComponent } from 'react';
import { WithTranslation } from 'react-i18next';
import { Text, View } from 'react-native';
import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
// @ts-ignore
import { INVITE_ENABLED, getFeatureFlag } from '../../../base/flags/';
import { INVITE_ENABLED } from '../../../base/flags/constants';
import { getFeatureFlag } from '../../../base/flags/functions';
import { translate } from '../../../base/i18n/functions';
// @ts-ignore
import { Icon, IconAddUser } from '../../../base/icons';
import Icon from '../../../base/icons/components/Icon';
import { IconAddUser } from '../../../base/icons/svg';
import { getParticipantCountWithFake } from '../../../base/participants/functions';
import Button from '../../../base/ui/components/native/Button';
import { BUTTON_TYPES } from '../../../base/ui/constants.native';

@ -1,8 +1,6 @@
/* eslint-disable lines-around-comment */
import i18n from 'i18next';
import { batch } from 'react-redux';
// @ts-ignore
import { appNavigate } from '../app/actions';
import { IStore } from '../app/types';
import {
@ -22,8 +20,8 @@ import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
import { SET_REDUCED_UI } from '../base/responsive-ui/actionTypes';
import { BUTTON_TYPES } from '../base/ui/constants.any';
// @ts-ignore
import { isCalendarEnabled } from '../calendar-sync';
import { isCalendarEnabled } from '../calendar-sync/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { FeedbackDialog } from '../feedback';
import { setFilmstripEnabled } from '../filmstrip/actions.any';
@ -37,7 +35,6 @@ import { showSalesforceNotification } from '../salesforce/actions';
import { setToolboxEnabled } from '../toolbox/actions.any';
import { DISMISS_CALENDAR_NOTIFICATION } from './actionTypes';
// @ts-ignore
import { dismissCalendarNotification, notifyKickedOut } from './actions';
@ -197,6 +194,7 @@ function _maybeDisplayCalendarNotification({ dispatch, getState }: IStore) {
if (eventURL && eventURL !== currentConferenceURL) {
// @ts-ignore
if ((!eventToShow && event.startDate > now && event.startDate < now + ALERT_MILLISECONDS)
// @ts-ignore
|| (event.startDate < now && event.endDate > now)) {
eventToShow = event;

@ -17,7 +17,6 @@ import Button from '../../base/ui/components/web/Button';
// @ts-ignore
import DialInSummary from '../../invite/components/dial-in-summary/web/DialInSummary';
import { openWebApp } from '../actions';
// @ts-ignore
import { _TNS } from '../constants';
// @ts-ignore
import { generateDeepLinkingURL } from '../functions';

@ -7,8 +7,6 @@ import { hideDialog } from '../../base/dialog/actions';
import { translate } from '../../base/i18n/functions';
import Dialog from '../../base/ui/components/web/Dialog';
import Tabs from '../../base/ui/components/web/Tabs';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { obtainDesktopSources } from '../functions';
// @ts-ignore

@ -54,9 +54,10 @@ export function sendFaceBoxToParticipants(
* @param {FaceLandmarks} faceLandmarks - Face landmarks to be sent.
* @returns {void}
*/
export function sendFaceExpressionToServer(conference: IJitsiConference, faceLandmarks: FaceLandmarks): void {
export function sendFaceExpressionToServer(conference: IJitsiConference | undefined,
faceLandmarks: FaceLandmarks): void {
try {
conference.sendFaceLandmarks(faceLandmarks);
conference?.sendFaceLandmarks(faceLandmarks);
} catch (err) {
logger.warn('Could not send the face landmarks to prosody', err);
}

@ -59,3 +59,24 @@ export function setTileViewDimensions() {
});
};
}
/**
* Add participant to the active participants list.
*
* @param {string} _participantId - The Id of the participant to be added.
* @param {boolean?} _pinned - Whether the participant is pinned or not.
* @returns {Object}
*/
export function addStageParticipant(_participantId: string, _pinned = false): any {
return {};
}
/**
* Remove participant from the active participants list.
*
* @param {string} _participantId - The Id of the participant to be removed.
* @returns {Object}
*/
export function removeStageParticipant(_participantId: string): any {
return {};
}

@ -1,9 +1,7 @@
/* eslint-disable lines-around-comment */
import React from 'react';
// @ts-ignore
import { IconModerator } from '../../../base/icons';
import { IconModerator } from '../../../base/icons/svg';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { BaseIndicator } from '../../../base/react';

@ -1,9 +1,7 @@
/* eslint-disable lines-around-comment */
import React from 'react';
// @ts-ignore
import { IconModerator } from '../../../base/icons';
import { IconModerator } from '../../../base/icons/svg';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { BaseIndicator } from '../../../base/react';

@ -7,8 +7,6 @@ import { pinParticipant } from '../base/participants/actions';
import { getParticipantById, getPinnedParticipant } from '../base/participants/functions';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { updateSettings } from '../base/settings/actions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { addStageParticipant, removeStageParticipant, setFilmstripVisible } from '../filmstrip/actions';
import { setTileView } from '../video-layout/actions.any';

@ -13,7 +13,6 @@ import Dialog from '../../../../base/ui/components/web/Dialog';
import { StatusCode } from '../../../../base/util/uri';
import { isDynamicBrandingDataLoaded } from '../../../../dynamic-branding/functions.any';
import { getActiveSession } from '../../../../recording/functions';
// @ts-ignore
import { updateDialInNumbers } from '../../../actions';
import {
_getDefaultPhoneNumber,
@ -23,12 +22,10 @@ import {
isDialOutEnabled,
isSharingEnabled,
sharingFeatures
// @ts-ignore
} from '../../../functions';
import CopyMeetingLinkSection from './CopyMeetingLinkSection';
import DialInLimit from './DialInLimit';
// @ts-ignore
import DialInSection from './DialInSection';
import InviteByEmailSection from './InviteByEmailSection';
// @ts-ignore

@ -5,8 +5,6 @@ import { translate } from '../../../../base/i18n/functions';
import Icon from '../../../../base/icons/components/Icon';
import { IconCopy } from '../../../../base/icons/svg';
import { copyText } from '../../../../base/util/copyText.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { _formatConferenceIDPin } from '../../../_utils';
/**

@ -5,8 +5,6 @@ import { makeStyles } from 'tss-react/mui';
import { IReduxState } from '../../../../app/types';
import { withPixelLineHeight } from '../../../../base/styles/functions.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { getDialInfoPageURL, hasMultipleNumbers } from '../../../functions';
import DialInNumber from './DialInNumber';

@ -1,4 +1,3 @@
/* eslint-disable lines-around-comment */
import { Theme } from '@mui/material';
import React from 'react';
import { WithTranslation } from 'react-i18next';
@ -6,7 +5,6 @@ import { makeStyles } from 'tss-react/mui';
import { translate } from '../../../../base/i18n/functions';
import { withPixelLineHeight } from '../../../../base/styles/functions.web';
// @ts-ignore
import { _formatConferenceIDPin } from '../../../_utils';
@ -15,12 +13,12 @@ interface IProps extends WithTranslation {
/**
* The conference id.
*/
conferenceID?: string | number;
conferenceID?: string | number;
/**
* The conference name.
*/
conferenceName: string;
conferenceName: string;
}
const useStyles = makeStyles()((theme: Theme) => {

@ -1,12 +1,11 @@
/* eslint-disable lines-around-comment */
import countries from 'i18n-iso-countries';
import en from 'i18n-iso-countries/langs/en.json';
import React, { useCallback, useMemo } from 'react';
import { WithTranslation } from 'react-i18next';
import { translate } from '../../../../base/i18n/functions';
// @ts-ignore
import { Icon, IconSip } from '../../../../base/icons';
import Icon from '../../../../base/icons/components/Icon';
import { IconSip } from '../../../../base/icons/svg';
countries.registerLocale(en);
@ -29,7 +28,7 @@ interface INormalizedNumber {
}
interface INumbersMapping {
[countryName: string]: Array<INormalizedNumber>;
[countryName: string]: Array<INormalizedNumber>;
}
interface IProps extends WithTranslation {
@ -48,7 +47,7 @@ interface IProps extends WithTranslation {
* The phone numbers to display. Can be an array of number Objects or an
* object with countries as keys and an array of numbers as values.
*/
numbers: INumbersMapping;
numbers: INumbersMapping;
}

@ -33,7 +33,7 @@ export function joinWithPassword(password: string) {
return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const conference = getCurrentConference(getState);
dispatch(setPassword(conference, conference.join, password));
dispatch(setPassword(conference, conference?.join, password));
};
}
@ -115,7 +115,7 @@ export function admitMultiple(participants: Array<IKnockingParticipant>) {
const conference = getCurrentConference(getState);
participants.forEach(p => {
conference.lobbyApproveAccess(p.id);
conference?.lobbyApproveAccess(p.id);
});
};
}
@ -232,9 +232,9 @@ export function toggleLobbyMode(enabled: boolean) {
const conference = getCurrentConference(getState);
if (enabled) {
conference.enableLobby();
conference?.enableLobby();
} else {
conference.disableLobby();
conference?.disableLobby();
}
};
}
@ -277,7 +277,7 @@ export function handleLobbyChatInitialized(payload: { attendee: IParticipant; mo
const state = getState();
const conference = getCurrentConference(state);
const id = conference.myLobbyUserId();
const id = conference?.myLobbyUserId();
dispatch({
type: SET_LOBBY_PARTICIPANT_CHAT_STATE,
@ -289,7 +289,7 @@ export function handleLobbyChatInitialized(payload: { attendee: IParticipant; mo
const attendeeIsKnocking = getKnockingParticipants(state).some(p => p.id === payload.attendee.id);
if (attendeeIsKnocking && conference.getRole() === 'moderator' && payload.moderator.id !== id) {
if (attendeeIsKnocking && conference?.getRole() === 'moderator' && payload.moderator.id !== id) {
dispatch(showNotification({
titleKey: 'lobby.lobbyChatStartedNotification',
titleArguments: {
@ -325,7 +325,7 @@ export function sendLobbyChatMessage(message: Object) {
return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
const conference = getCurrentConference(getState);
conference.sendLobbyMessage(message);
conference?.sendLobbyMessage(message);
};
}
@ -395,7 +395,7 @@ export function setLobbyMessageListener() {
return;
}
conference.addLobbyMessageListener((message: any, participantId: string) => {
conference?.addLobbyMessageListener((message: any, participantId: string) => {
if (message.type === LOBBY_CHAT_MESSAGE) {
return dispatch(handleLobbyMessageReceived(message.message, participantId));
}

@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import i18n from 'i18next';
import { batch } from 'react-redux';
import { AnyAction } from 'redux';
@ -28,7 +26,6 @@ import {
} from '../base/sounds/actions';
import { isTestModeEnabled } from '../base/testing/functions';
import { BUTTON_TYPES } from '../base/ui/constants.any';
// @ts-ignore
import { openChat } from '../chat/actions';
import {
handleLobbyChatInitialized,
@ -228,8 +225,7 @@ function _handleLobbyNotification(store: IStore) {
customActionType.splice(1, 0, BUTTON_TYPES.SECONDARY);
customActionHandler.splice(1, 0, () => batch(() => {
dispatch(handleLobbyChatInitialized(firstParticipant.id));
// @ts-ignore
dispatch(openChat(disablePolls));
dispatch(openChat({}, disablePolls));
}));
}
} else {
@ -287,7 +283,6 @@ function _conferenceFailed({ dispatch, getState }: IStore, next: Function, actio
// In case of wrong password we need to be in the right state if in the meantime someone allows us to join
if (nonFirstFailure) {
// @ts-ignore
dispatch(conferenceWillJoin(membersOnly));
}

@ -79,7 +79,6 @@ export function setNoiseSuppressionEnabled(enabled: boolean): any {
error
);
// @ts-ignore
dispatch(showErrorNotification({
titleKey: 'notify.noiseSuppressionFailedTitle'
}, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));

@ -1,7 +1,8 @@
/* eslint-disable max-len */
// @ts-ignore
import { PageReloadDialog, openDialog } from '../base/dialog';
import { PageReloadDialog } from '../base/dialog';
import { openDialog } from '../base/dialog/actions';
/**

@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import { IStore } from '../app/types';
import { JitsiConferenceErrors } from '../base/lib-jitsi-meet';
import {
@ -8,7 +6,6 @@ import {
} from '../base/lib-jitsi-meet/functions.any';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
// @ts-ignore
import { openPageReloadDialog } from './actions';

@ -7,8 +7,8 @@ import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
import { translate } from '../../../base/i18n/functions';
// @ts-ignore
import { Icon, IconAddUser } from '../../../base/icons';
import Icon from '../../../base/icons/components/Icon';
import { IconAddUser } from '../../../base/icons/svg';
import {
getLocalParticipant,
getParticipantCountWithFake,

@ -7,9 +7,7 @@ import { sendAnalytics } from '../../../analytics/functions';
import { IconAddUser } from '../../../base/icons/svg';
import Button from '../../../base/ui/components/web/Button';
import { BUTTON_TYPES } from '../../../base/ui/constants.web';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { beginAddPeople } from '../../../invite';
import { beginAddPeople } from '../../../invite/actions';
export const InviteButton = () => {
const dispatch = useDispatch();

@ -16,8 +16,6 @@ import {
getLocalVideoTrack
} from '../base/tracks/functions';
import { openURLInBrowser } from '../base/util/openURLInBrowser';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { executeDialOutRequest, executeDialOutStatusRequest, getDialInfoPageURL } from '../invite/functions';
import { showErrorNotification } from '../notifications/actions';
import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';

@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { WithTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
@ -8,11 +6,10 @@ import { translate } from '../../../../base/i18n/functions';
import Icon from '../../../../base/icons/components/Icon';
import { IconArrowLeft } from '../../../../base/icons/svg';
import Button from '../../../../base/ui/components/web/Button';
// @ts-ignore
import { getCountryCodeFromPhone } from '../../../utils';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import Label from '../Label';
/* eslint-enable lines-around-comment */
interface IProps extends WithTranslation {

@ -1,5 +1,3 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { WithTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
@ -8,11 +6,10 @@ import { translate } from '../../../../base/i18n/functions';
import Icon from '../../../../base/icons/components/Icon';
import { IconCloseLarge } from '../../../../base/icons/svg';
import Button from '../../../../base/ui/components/web/Button';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import Label from '../Label';
// @ts-ignore
import CountryPicker from '../country-picker/CountryPicker';
/* eslint-enable lines-around-comment */
interface IProps extends WithTranslation {

@ -7,8 +7,6 @@ import {
_STORE_CURRENT_CONFERENCE,
_UPDATE_CONFERENCE_DURATION
} from './actionTypes';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { isRecentListEnabled } from './functions';
interface IRecent {

@ -5,13 +5,8 @@ import { WithTranslation } from 'react-i18next';
import { createRecordingDialogEvent } from '../../../analytics/AnalyticsEvents';
import { sendAnalytics } from '../../../analytics/functions';
import { IReduxState } from '../../../app/types';
// @ts-ignore
import { ColorSchemeRegistry } from '../../../base/color-scheme';
// @ts-ignore
import {
_abstractMapStateToProps
// @ts-ignore
} from '../../../base/dialog';
import ColorSchemeRegistry from '../../../base/color-scheme/ColorSchemeRegistry';
import { _abstractMapStateToProps } from '../../../base/dialog/functions';
// @ts-ignore
import { StyleType } from '../../../base/styles';
import { authorizeDropbox, updateDropboxToken } from '../../../dropbox/actions';
@ -341,7 +336,7 @@ export function mapStateToProps(state: IReduxState) {
return {
..._abstractMapStateToProps(state),
isVpaas: isVpaasMeeting(state),
_hideStorageWarning: recordingService?.hideStorageWarning,
_hideStorageWarning: Boolean(recordingService?.hideStorageWarning),
_localRecordingAvailable,
_localRecordingEnabled: !localRecording?.disable,
_localRecordingSelfEnabled: !localRecording?.disableSelfRecording,

@ -11,7 +11,6 @@ import Button from '../../../../base/ui/components/native/Button';
import Switch from '../../../../base/ui/components/native/Switch';
import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
import { RECORDING_TYPES } from '../../../constants';
// @ts-ignore
import { getRecordingDurationEstimation } from '../../../functions';
import AbstractStartRecordingDialogContent, {
IProps,

@ -14,10 +14,8 @@ import Tooltip from '../../../../base/tooltip/components/Tooltip';
import BaseTheme from '../../../../base/ui/components/BaseTheme.web';
import { maybeShowPremiumFeatureDialog } from '../../../../jaas/actions';
import AbstractHighlightButton, {
type IProps as AbstractProps,
IProps as AbstractProps,
_abstractMapStateToProps
// @ts-ignore
} from '../AbstractHighlightButton';
type Props = AbstractProps & {

@ -8,11 +8,7 @@ import { IconRecord, IconSites } from '../../../base/icons/svg';
import Label from '../../../base/label/components/web/Label';
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
import Tooltip from '../../../base/tooltip/components/Tooltip';
import AbstractRecordingLabel, {
_mapStateToProps
// @ts-ignore
} from '../AbstractRecordingLabel';
import AbstractRecordingLabel, { _mapStateToProps } from '../AbstractRecordingLabel';
/**
* Creates the styles for the component.

@ -32,7 +32,7 @@ export const useSalesforceLinkDialog = () => {
const [ hasRecordsErrors, setRecordsErrors ] = useState(false);
const [ hasDetailsErrors, setDetailsErrors ] = useState(false);
const conference = useSelector(getCurrentConference);
const sessionId = conference.getMeetingUniqueId();
const sessionId = conference?.getMeetingUniqueId();
const { salesforceUrl = '' } = useSelector((state: IReduxState) => state['features/base/config']);
const { jwt = '' } = useSelector((state: IReduxState) => state['features/base/jwt']);
const showSearchResults = searchTerm && searchTerm.length > 1;

@ -192,10 +192,10 @@ function handleSharingVideoStatus(store: IStore, videoUrl: string,
* @returns {void}
*/
function sendShareVideoCommand({ id, status, conference, localParticipantId = '', time, muted, volume }: {
conference: IJitsiConference; id: string; localParticipantId?: string; muted: boolean;
conference?: IJitsiConference; id: string; localParticipantId?: string; muted: boolean;
status: string; time: number; volume: number;
}) {
conference.sendCommandOnce(SHARED_VIDEO, {
conference?.sendCommandOnce(SHARED_VIDEO, {
value: id,
attributes: {
from: localParticipantId,

@ -1,8 +1,6 @@
import { IStore } from '../../app/types';
import { IconConnection } from '../../base/icons/svg';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
type Props = AbstractButtonProps & {
@ -16,7 +14,7 @@ type Props = AbstractButtonProps & {
/**
* Implementation of a button for opening speaker stats dialog.
*/
class AbstractSpeakerStatsButton extends AbstractButton<Props, any, any> {
class AbstractSpeakerStatsButton extends AbstractButton<Props> {
accessibilityLabel = 'toolbar.accessibilityLabel.speakerStats';
icon = IconConnection;
label = 'toolbar.speakerStats';

@ -21,7 +21,6 @@ class SpeakerStatsButton extends AbstractSpeakerStatsButton {
* @returns {void}
*/
_handleClick() {
// @ts-ignore
const { dispatch } = this.props;
sendAnalytics(createToolbarEvent('speaker.stats'));
@ -29,5 +28,4 @@ class SpeakerStatsButton extends AbstractSpeakerStatsButton {
}
}
// @ts-ignore
export default translate(connect()(SpeakerStatsButton));

@ -3,11 +3,8 @@ import { makeStyles } from 'tss-react/mui';
import { withPixelLineHeight } from '../../../base/styles/functions.web';
import { MOBILE_BREAKPOINT } from '../../constants';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import abstractSpeakerStatsList from '../AbstractSpeakerStatsList';
// @ts-ignore
import SpeakerStatsItem from './SpeakerStatsItem';
const useStyles = makeStyles()(theme => {

@ -1 +1,11 @@
export * from './actions.any';
/**
* Shows the toolbox for specified timeout.
*
* @param {number} _timeout - Timeout for showing the toolbox.
* @returns {Function}
*/
export function showToolbox(_timeout?: number): any {
return {};
}

@ -6,8 +6,7 @@ import { CAR_MODE_ENABLED } from '../../../base/flags/constants';
import { getFeatureFlag } from '../../../base/flags/functions';
import { translate } from '../../../base/i18n/functions';
import { IconCar } from '../../../base/icons/svg';
// @ts-ignore
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
import { navigate }
// @ts-ignore
from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
@ -18,7 +17,7 @@ import { screen } from '../../../mobile/navigation/routes';
/**
* Implements an {@link AbstractButton} to open the carmode.
*/
class OpenCarmodeButton extends AbstractButton<AbstractButtonProps, any, any> {
class OpenCarmodeButton extends AbstractButton<AbstractButtonProps> {
accessibilityLabel = 'toolbar.accessibilityLabel.carmode';
icon = IconCar;
label = 'carmode.labels.buttonLabel';

@ -1,14 +1,13 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { Platform } from 'react-native';
import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
// @ts-ignore
import { isDesktopShareButtonDisabled } from '../../functions.native';
// @ts-ignore
import ScreenSharingAndroidButton from './ScreenSharingAndroidButton.js';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import ScreenSharingIosButton from './ScreenSharingIosButton.js';

@ -22,8 +22,7 @@ import { setVolume } from '../../../filmstrip/actions.web';
import { isStageFilmstripAvailable } from '../../../filmstrip/functions.web';
import { QUICK_ACTION_BUTTON } from '../../../participants-pane/constants';
import { getQuickActionButtonType, isForceMuted } from '../../../participants-pane/functions';
// @ts-ignore
import { requestRemoteControl, stopController } from '../../../remote-control';
import { requestRemoteControl, stopController } from '../../../remote-control/actions';
import { showOverflowDrawer } from '../../../toolbox/functions.web';
import { iAmVisitor } from '../../../visitors/functions';

@ -1,6 +1,6 @@
/* eslint-disable lines-around-comment */
// @ts-ignore
import Bourne from '@hapi/bourne';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils/jitsi-local-storage';
import React, { useCallback, useEffect, useState } from 'react';

@ -6,7 +6,6 @@ import BaseTheme from '../base/ui/components/BaseTheme';
// @ts-ignore
import TabIcon from './components/TabIcon';
// @ts-ignore
export const ACTIVE_TAB_COLOR = BaseTheme.palette.icon01;
export const INACTIVE_TAB_COLOR = BaseTheme.palette.icon03;

@ -64,7 +64,7 @@ MiddlewareRegistry.register((store: IStore) => (next: Function) => async (action
focusWhiteboard(store);
dispatch(setupWhiteboard({ collabDetails }));
conference.getMetadataHandler().setMetadata(WHITEBOARD_ID, {
conference?.getMetadataHandler().setMetadata(WHITEBOARD_ID, {
collabServerUrl,
collabDetails
});
@ -95,11 +95,7 @@ MiddlewareRegistry.register((store: IStore) => (next: Function) => async (action
* is left or failed, e.g. Disable the whiteboard if it's left open.
*/
StateListenerRegistry.register(
// @ts-ignore
state => getCurrentConference(state),
// @ts-ignore
(conference, { dispatch }, previousConference): void => {
if (conference !== previousConference) {
dispatch(resetWhiteboard());

Loading…
Cancel
Save