Compare commits

..

1 Commits

Author SHA1 Message Date
Saúl Ibarra Corretgé
d2521bc67a feat(android) bump minimum API level to 24
Some of our dependencies (most notably WebRTC) have dropped it and we
can no longer claim to support API level 23).
2023-05-01 11:06:44 +02:00
307 changed files with 2392 additions and 2590 deletions

View File

@@ -45,12 +45,6 @@ class AudioDeviceHandlerGeneric implements
*/
private AudioModeModule module;
/**
* Constant defining a Hearing Aid. Only available on API level >= 28.
* The value of: AudioDeviceInfo.TYPE_HEARING_AID
*/
private static final int TYPE_HEARING_AID = 23;
/**
* Constant defining a USB headset. Only available on API level >= 26.
* The value of: AudioDeviceInfo.TYPE_USB_HEADSET
@@ -91,7 +85,6 @@ class AudioDeviceHandlerGeneric implements
break;
case AudioDeviceInfo.TYPE_WIRED_HEADPHONES:
case AudioDeviceInfo.TYPE_WIRED_HEADSET:
case TYPE_HEARING_AID:
case TYPE_USB_HEADSET:
devices.add(AudioModeModule.DEVICE_HEADPHONES);
break;

View File

@@ -559,7 +559,7 @@ export default {
);
}
let tryCreateLocalTracks = Promise.resolve([]);
let tryCreateLocalTracks;
// On Electron there is no permission prompt for granting permissions. That's why we don't need to
// spend much time displaying the overlay screen. If GUM is not resolved within 15 seconds it will
@@ -600,65 +600,76 @@ export default {
return [];
});
} else if (requestedAudio || requestedVideo) {
} else if (!requestedAudio && !requestedVideo) {
// Resolve with no tracks
tryCreateLocalTracks = Promise.resolve([]);
} else {
tryCreateLocalTracks = createLocalTracksF({
devices: initialDevices,
timeout,
firePermissionPromptIsShownEvent: true
})
.catch(async error => {
if (error.name === JitsiTrackErrors.TIMEOUT && !browser.isElectron()) {
errors.audioAndVideoError = error;
.catch(err => {
if (requestedAudio && requestedVideo) {
// Try audio only...
errors.audioAndVideoError = err;
if (err.name === JitsiTrackErrors.TIMEOUT && !browser.isElectron()) {
// In this case we expect that the permission prompt is still visible. There is no point of
// executing GUM with different source. Also at the time of writing the following
// inconsistency have been noticed in some browsers - if the permissions prompt is visible
// and another GUM is executed the prompt does not change its content but if the user
// clicks allow the user action isassociated with the latest GUM call.
errors.audioOnlyError = err;
errors.videoOnlyError = err;
return [];
}
return createLocalTracksF(audioOptions);
} else if (requestedAudio && !requestedVideo) {
errors.audioOnlyError = err;
return [];
} else if (requestedVideo && !requestedAudio) {
errors.videoOnlyError = err;
return [];
}
logger.error('Should never happen');
})
.catch(err => {
// Log this just in case...
if (!requestedAudio) {
logger.error('The impossible just happened', err);
}
errors.audioOnlyError = err;
// Try video only...
return requestedVideo
? createLocalTracksF({
devices: [ MEDIA_TYPE.VIDEO ],
firePermissionPromptIsShownEvent: true
})
: [];
})
.catch(err => {
// Log this just in case...
if (!requestedVideo) {
logger.error('The impossible just happened', err);
}
errors.videoOnlyError = err;
return [];
}
// Retry with separate gUM calls.
const gUMPromises = [];
const tracks = [];
if (requestedAudio) {
gUMPromises.push(createLocalTracksF(audioOptions));
}
if (requestedVideo) {
gUMPromises.push(createLocalTracksF({
devices: [ MEDIA_TYPE.VIDEO ],
timeout,
firePermissionPromptIsShownEvent: true
}));
}
const results = await Promise.allSettled(gUMPromises);
let errorMsg;
results.forEach((result, idx) => {
if (result.status === 'fulfilled') {
tracks.push(result.value[0]);
} else {
errorMsg = result.reason;
const isAudio = idx === 0;
logger.error(`${isAudio ? 'Audio' : 'Video'} track creation failed with error ${errorMsg}`);
if (isAudio) {
errors.audioOnlyError = errorMsg;
} else {
errors.videoOnlyError = errorMsg;
}
}
});
if (errors.audioOnlyError && errors.videoOnlyError) {
errors.audioAndVideoError = errorMsg;
}
return tracks;
});
}
// Hide the permissions prompt/overlay as soon as the tracks are created. Don't wait for the connection to
// be established, as in some cases like when auth is required, connection won't be established until the user
// inputs their credentials, but the dialog would be overshadowed by the overlay.
// Hide the permissions prompt/overlay as soon as the tracks are
// created. Don't wait for the connection to be made, since in some
// cases, when auth is required, for instance, that won't happen until
// the user inputs their credentials, but the dialog would be
// overshadowed by the overlay.
tryCreateLocalTracks.then(tracks => {
APP.store.dispatch(mediaPermissionPromptVisibilityChanged(false));
@@ -799,51 +810,43 @@ export default {
const initialOptions = {
startAudioOnly: config.startAudioOnly,
startScreenSharing: config.startScreenSharing,
startWithAudioMuted: getStartWithAudioMuted(state) || isUserInteractionRequiredForUnmute(state),
startWithVideoMuted: getStartWithVideoMuted(state) || isUserInteractionRequiredForUnmute(state)
startWithAudioMuted: getStartWithAudioMuted(state)
|| isUserInteractionRequiredForUnmute(state),
startWithVideoMuted: getStartWithVideoMuted(state)
|| isUserInteractionRequiredForUnmute(state)
};
this.roomName = roomName;
try {
// Initialize the device list first. This way, when creating tracks based on preferred devices, loose label
// matching can be done in cases where the exact ID match is no longer available, such as -
// 1. When the camera device has switched USB ports.
// 2. When in startSilent mode we want to start with audio muted
// Initialize the device list first. This way, when creating tracks
// based on preferred devices, loose label matching can be done in
// cases where the exact ID match is no longer available, such as
// when the camera device has switched USB ports.
// when in startSilent mode we want to start with audio muted
await this._initDeviceList();
} catch (error) {
logger.warn('initial device list initialization failed', error);
}
// Filter out the local tracks based on various config options, i.e., when user joins muted or is muted by
// focus. However, audio track will always be created even though it is not added to the conference since we
// want audio related features (noisy mic, talk while muted, etc.) to work even if the mic is muted.
const handleInitialTracks = (options, tracks) => {
let localTracks = tracks;
// No local tracks are added when user joins as a visitor.
if (iAmVisitor(state)) {
return [];
}
if (options.startWithAudioMuted || room?.isStartAudioMuted()) {
const handleStartAudioMuted = (options, tracks) => {
if (options.startWithAudioMuted) {
// Always add the track on Safari because of a known issue where audio playout doesn't happen
// if the user joins audio and video muted, i.e., if there is no local media capture.
if (browser.isWebKitBased()) {
this.muteAudio(true, true);
} else {
localTracks = localTracks.filter(track => track.getType() !== MEDIA_TYPE.AUDIO);
return tracks.filter(track => track.getType() !== MEDIA_TYPE.AUDIO);
}
}
if (room?.isStartVideoMuted()) {
localTracks = localTracks.filter(track => track.getType() !== MEDIA_TYPE.VIDEO);
}
return localTracks;
return tracks;
};
if (isPrejoinPageVisible(state)) {
_connectionPromise = connect(roomName).then(c => {
// We want to initialize it early, in case of errors to be able to gather logs.
// we want to initialize it early, in case of errors to be able
// to gather logs
APP.connection = c;
return c;
@@ -856,28 +859,48 @@ export default {
APP.store.dispatch(makePrecallTest(this._getConferenceOptions()));
const { tryCreateLocalTracks, errors } = this.createInitialLocalTracks(initialOptions);
const localTracks = await tryCreateLocalTracks;
const tracks = await tryCreateLocalTracks;
// Initialize device list a second time to ensure device labels get populated in case of an initial gUM
// acceptance; otherwise they may remain as empty strings.
// Initialize device list a second time to ensure device labels
// get populated in case of an initial gUM acceptance; otherwise
// they may remain as empty strings.
this._initDeviceList(true);
if (isPrejoinPageVisible(state)) {
return APP.store.dispatch(initPrejoin(localTracks, errors));
return APP.store.dispatch(initPrejoin(tracks, errors));
}
logger.debug('Prejoin screen no longer displayed at the time when tracks were created');
this._displayErrorsForCreateInitialLocalTracks(errors);
return this._setLocalAudioVideoStreams(handleInitialTracks(initialOptions, localTracks));
let localTracks = handleStartAudioMuted(initialOptions, tracks);
// In case where gUM is slow and resolves after the startAudio/VideoMuted coming from jicofo, we can be
// join unmuted even though jicofo had instruct us to mute, so let's respect that before passing the tracks
if (!browser.isWebKitBased()) {
if (room?.isStartAudioMuted()) {
localTracks = localTracks.filter(track => track.getType() !== MEDIA_TYPE.AUDIO);
}
}
if (room?.isStartVideoMuted()) {
localTracks = localTracks.filter(track => track.getType() !== MEDIA_TYPE.VIDEO);
}
// Do not add the tracks if the user has joined the call as a visitor.
if (iAmVisitor(state)) {
return Promise.resolve();
}
return this._setLocalAudioVideoStreams(localTracks);
}
const [ tracks, con ] = await this.createInitialLocalTracksAndConnect(roomName, initialOptions);
this._initDeviceList(true);
return this.startConference(con, handleInitialTracks(initialOptions, tracks));
return this.startConference(con, handleStartAudioMuted(initialOptions, tracks));
},
/**
@@ -1050,7 +1073,7 @@ export default {
*/
muteVideo(mute, showUI = true) {
if (this.videoSwitchInProgress) {
logger.warn('muteVideo - unable to perform operations while video switch is in progress');
console.warn('muteVideo - unable to perform operations while video switch is in progress');
return;
}

View File

@@ -74,6 +74,10 @@
a:active {
color: black;
}
&::-webkit-scrollbar-corner {
background: #3a3a3a;
}
}

View File

@@ -134,7 +134,7 @@ PODS:
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
- GTMSessionFetcher/Core (2.3.0)
- JitsiWebRTC (111.0.2)
- JitsiWebRTC (111.0.1)
- libwebp (1.2.4):
- libwebp/demux (= 1.2.4)
- libwebp/mux (= 1.2.4)
@@ -725,7 +725,7 @@ SPEC CHECKSUMS:
GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
JitsiWebRTC: 80f62908fcf2a1160e0d14b584323fb6e6be630b
JitsiWebRTC: 9619c1f71cc16eeca76df68aa2d213c6d63274a8
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
ObjectiveDropboxOfficial: fe206ce8c0bc49976c249d472db7fdbc53ebbd53

View File

@@ -98,6 +98,7 @@ platform :ios do
demo_account_required: false,
distribute_external: true,
groups: ENV["JITSI_BETA_TESTING_GROUPS"],
reject_build_waiting_for_review: true,
uses_non_exempt_encryption: false
)

View File

@@ -1150,7 +1150,6 @@
"privateMessage": "Send private message",
"profile": "Edit your profile",
"raiseHand": "Raise your hand",
"reactions": "Reactions",
"reactionsMenu": "Reactions menu",
"recording": "Toggle recording",
"remoteMute": "Mute participant",
@@ -1248,7 +1247,6 @@
"reactionLike": "Send thumbs up reaction",
"reactionSilence": "Send silence reaction",
"reactionSurprised": "Send surprised reaction",
"reactions": "Reactions",
"security": "Security options",
"selectBackground": "Select background",
"shareRoom": "Invite someone",

View File

@@ -113,8 +113,6 @@ import { isAudioMuteButtonDisabled } from '../../react/features/toolbox/function
import { setTileView, toggleTileView } from '../../react/features/video-layout/actions.any';
import { muteAllParticipants } from '../../react/features/video-menu/actions';
import { setVideoQuality } from '../../react/features/video-quality/actions';
import { toggleWhiteboard } from '../../react/features/whiteboard/actions.any';
import { WhiteboardStatus } from '../../react/features/whiteboard/types';
import { getJitsiMeetTransport } from '../transport';
import {
@@ -835,9 +833,6 @@ function initCommands() {
} else {
logger.error(' End Conference not supported');
}
},
'toggle-whiteboard': () => {
APP.store.dispatch(toggleWhiteboard());
}
};
transport.on('event', ({ data, name }) => {
@@ -2019,20 +2014,6 @@ class API {
});
}
/**
* Notify external application (if API is enabled) if whiteboard state is
* changed.
*
* @param {WhiteboardStatus} status - The new whiteboard status.
* @returns {void}
*/
notifyWhiteboardStatusChanged(status: WhiteboardStatus) {
this._sendEvent({
name: 'whiteboard-status-changed',
status
});
}
/**
* Disposes the allocated resources.
*

View File

@@ -90,8 +90,7 @@ const commands = {
toggleSubtitles: 'toggle-subtitles',
toggleTileView: 'toggle-tile-view',
toggleVirtualBackgroundDialog: 'toggle-virtual-background',
toggleVideo: 'toggle-video',
toggleWhiteboard: 'toggle-whiteboard'
toggleVideo: 'toggle-video'
};
/**
@@ -155,8 +154,7 @@ const events = {
'subject-change': 'subjectChange',
'suspend-detected': 'suspendDetected',
'tile-view-changed': 'tileViewChanged',
'toolbar-button-clicked': 'toolbarButtonClicked',
'whiteboard-status-changed': 'whiteboardStatusChanged'
'toolbar-button-clicked': 'toolbarButtonClicked'
};
/**

722
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -65,7 +65,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1631.0.0+f0dd4039/lib-jitsi-meet.tgz",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1626.0.0+a41aa571/lib-jitsi-meet.tgz",
"lodash": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",
@@ -76,7 +76,7 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"react-emoji-render": "1.2.4",
"react-focus-lock": "2.9.4",
"react-focus-lock": "2.5.1",
"react-i18next": "10.11.4",
"react-linkify": "1.0.0-alpha",
"react-native": "0.68.6",
@@ -140,7 +140,6 @@
"@types/react-dom": "17.0.14",
"@types/react-linkify": "1.0.1",
"@types/react-native": "0.68.9",
"@types/react-native-keep-awake": "2.0.3",
"@types/react-native-video": "5.0.14",
"@types/react-redux": "7.1.24",
"@types/react-window": "1.8.5",
@@ -150,8 +149,8 @@
"@types/w3c-image-capture": "1.0.6",
"@types/w3c-web-hid": "1.0.3",
"@types/zxcvbn": "4.4.1",
"@typescript-eslint/eslint-plugin": "5.59.5",
"@typescript-eslint/parser": "5.59.5",
"@typescript-eslint/eslint-plugin": "5.30.5",
"@typescript-eslint/parser": "5.30.4",
"babel-loader": "8.2.3",
"babel-plugin-optional-require": "0.3.1",
"circular-dependency-plugin": "5.2.0",
@@ -171,8 +170,8 @@
"sass": "1.26.8",
"style-loader": "3.3.1",
"traverse": "0.6.6",
"ts-loader": "9.4.2",
"typescript": "5.0.4",
"ts-loader": "9.4.1",
"typescript": "4.7.4",
"unorm": "1.6.0",
"webpack": "5.76.0",
"webpack-bundle-analyzer": "4.4.2",
@@ -180,7 +179,7 @@
"webpack-dev-server": "4.7.3"
},
"overrides": {
"strophe.js@1.5.0": {
"strophe.js@1.6.0": {
"@xmldom/xmldom": "0.8.7"
}
},

View File

@@ -1,3 +1,4 @@
/* eslint-disable lines-around-comment */
import { setRoom } from '../base/conference/actions';
import {
configWillLoad,
@@ -19,11 +20,14 @@ import {
parseURIString,
toURLString
} from '../base/util/uri';
// @ts-ignore
import { isPrejoinPageEnabled } from '../mobile/navigation/functions';
import {
goBackToRoot,
navigateRoot
// @ts-ignore
} from '../mobile/navigation/rootNavigationContainerRef';
// @ts-ignore
import { screen } from '../mobile/navigation/routes';
import { clearNotifications } from '../notifications/actions';
@@ -51,7 +55,7 @@ export function appNavigate(uri?: string, options: IReloadNowOptions = {}) {
// If the specified location (URI) does not identify a host, use the app's
// default.
if (!location?.host) {
if (!location || !location.host) {
const defaultLocation = parseURIString(getDefaultURL(getState));
if (location) {
@@ -139,6 +143,7 @@ export function appNavigate(uri?: string, options: IReloadNowOptions = {}) {
dispatch(createDesiredLocalTracks());
dispatch(clearNotifications());
// @ts-ignore
const { hidePrejoin } = options;
if (!hidePrejoin && isPrejoinPageEnabled(getState())) {

View File

@@ -49,7 +49,7 @@ export function appNavigate(uri?: string) {
// If the specified location (URI) does not identify a host, use the app's
// default.
if (!location?.host) {
if (!location || !location.host) {
const defaultLocation = parseURIString(getDefaultURL(getState));
if (location) {

View File

@@ -5,6 +5,8 @@ import { IStateful } from '../base/app/types';
import { isRoomValid } from '../base/conference/functions';
import { isSupportedBrowser } from '../base/environment/environment';
import { toState } from '../base/redux/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import Conference from '../conference/components/web/Conference';
import { getDeepLinkingPage } from '../deep-linking/functions';
import UnsupportedDesktopBrowser from '../unsupported-browser/components/UnsupportedDesktopBrowser';

View File

@@ -27,13 +27,13 @@ export function cancelLogin() {
// a reaction to CONNECTION_FAILED). Since the
// app/user is going to navigate to WelcomePage, the SDK
// clients/consumers need an event.
const { error = { recoverable: undefined }, passwordRequired }
const { error, passwordRequired }
= getState()['features/base/connection'];
passwordRequired
&& dispatch(
connectionFailed(
passwordRequired,
passwordRequired, // @ts-ignore
set(error, 'recoverable', false) as any));
};
}

View File

@@ -1,2 +1,4 @@
export { default as LoginDialog } from './native/LoginDialog';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
export { default as WaitForOwnerDialog } from './native/WaitForOwnerDialog';

View File

@@ -24,7 +24,7 @@ import {
openLoginDialog,
openWaitForOwnerDialog,
stopWaitForOwner,
waitForOwner } from './actions.native';
waitForOwner } from './actions.native'; // @ts-ignore
import { LoginDialog, WaitForOwnerDialog } from './components';
/**

View File

@@ -292,7 +292,7 @@ export function getVisitorOptions(stateful: IStateful, params: Array<string>) {
const config = toState(stateful)['features/base/config'];
if (!config?.hosts) {
if (!config || !config.hosts) {
logger.warn('Wrong configuration, missing hosts.');
return;
@@ -300,8 +300,7 @@ export function getVisitorOptions(stateful: IStateful, params: Array<string>) {
if (!vnode) {
// this is redirecting back to main, lets restore config
// not updating disableFocus, as if the room capacity is full the promotion to the main room will fail
// and the visitor will be redirected back to a vnode from jicofo
// no point of updating disableFocus, we can skip the initial iq to jicofo
if (config.oldConfig && username) {
return {
hosts: {
@@ -311,7 +310,6 @@ export function getVisitorOptions(stateful: IStateful, params: Array<string>) {
focusUserJid: focusJid,
disableLocalStats: false,
bosh: config.oldConfig.bosh && appendURLParam(config.oldConfig.bosh, 'customusername', username),
p2p: config.oldConfig.p2p,
websocket: config.oldConfig.websocket
&& appendURLParam(config.oldConfig.websocket, 'customusername', username),
oldConfig: undefined // clears it up
@@ -328,7 +326,6 @@ export function getVisitorOptions(stateful: IStateful, params: Array<string>) {
},
focusUserJid: config.focusUserJid,
bosh: config.bosh,
p2p: config.p2p,
websocket: config.websocket
};
@@ -344,10 +341,6 @@ export function getVisitorOptions(stateful: IStateful, params: Array<string>) {
disableFocus: true, // This flag disables sending the initial conference request
disableLocalStats: true,
bosh: config.bosh && appendURLParam(config.bosh, 'vnode', vnode),
p2p: {
...config.p2p,
enabled: false
},
websocket: config.websocket && appendURLParam(config.websocket, 'vnode', vnode)
};
}

View File

@@ -289,12 +289,6 @@ function _conferenceJoined({ dispatch, getState }: IStore, next: Function, actio
dispatch(conferenceWillLeave(conference));
};
if (!iAmVisitor(getState())) {
// if a visitor is promoted back to main room and want to join an empty breakout room
// we need to send iq to jicofo, so it can join/create the breakout room
dispatch(overwriteConfig({ disableFocus: false }));
}
// @ts-ignore
window.addEventListener(disableBeforeUnloadHandlers ? 'unload' : 'beforeunload', beforeUnloadHandler);

View File

@@ -46,7 +46,6 @@ export interface IJitsiConference {
authenticateAndUpgradeRole: Function;
avModerationApprove: Function;
avModerationReject: Function;
callUUID?: string;
createVideoSIPGWSession: Function;
dial: Function;
disableAVModeration: Function;

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils';
import { IStore } from '../../app/types';

View File

@@ -18,7 +18,6 @@ type ToolbarButtons = 'camera' |
'participants-pane' |
'profile' |
'raisehand' |
'reactions' |
'recording' |
'security' |
'select-background' |
@@ -170,7 +169,6 @@ export interface IConfig {
}>;
callDisplayName?: string;
callFlowsEnabled?: boolean;
callHandle?: string;
callStatsConfigParams?: {
additionalIDs?: {
customerID?: string;
@@ -192,7 +190,6 @@ export interface IConfig {
};
callStatsID?: string;
callStatsSecret?: string;
callUUID?: string;
channelLastN?: number;
chromeExtensionBanner?: {
chromeExtensionsInfo?: Array<{ id: string; path: string; }>;

View File

@@ -64,7 +64,7 @@ export const THIRD_PARTY_PREJOIN_BUTTONS = [ 'microphone', 'camera', 'select-bac
/**
* The toolbar buttons to show when in visitors mode.
*/
export const VISITORS_MODE_BUTTONS = [ 'chat', 'hangup', 'raisehand', 'settings', 'tileview' ];
export const VISITORS_MODE_BUTTONS = [ 'chat', 'hangup', 'raisehand', 'tileview' ];
/**
* The set of feature flags.

View File

@@ -1,7 +1,7 @@
// @ts-expect-error
// @ts-ignore
import Bourne from '@hapi/bourne';
// eslint-disable-next-line lines-around-comment
// @ts-expect-error
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils';
import _ from 'lodash';

View File

@@ -84,7 +84,6 @@ export interface IConfigState extends IConfig {
domain: string;
muc: string;
};
p2p?: object;
websocket?: string;
};
}

View File

@@ -36,7 +36,7 @@ type Props = {
/**
* Function to render a bottom sheet footer element, if necessary.
*/
renderFooter?: () => React.ReactNode;
renderFooter?: Function;
/**
* Function to render a bottom sheet header element, if necessary.
@@ -109,7 +109,9 @@ class BottomSheet extends PureComponent<Props> {
} = this.props;
return (
<SlidingView
<SlidingView // @ts-ignore
accessibilityRole = 'menu'
accessibilityViewIsModal = { true }
onHide = { this._onCancel }
position = 'bottom'
show = { Boolean(showSlidingView) }>

View File

@@ -18,7 +18,7 @@ interface IProps extends AbstractProps, WithTranslation {
/**
* The dialog descriptionKey.
*/
descriptionKey?: string;
descriptionKey: string;
/**
* An optional initial value to initiate the field with.

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import { randomInt } from '@jitsi/js-utils/random';
import React, { Component } from 'react';
import { WithTranslation } from 'react-i18next';
@@ -11,6 +11,7 @@ import { isFatalJitsiConnectionError } from '../../../lib-jitsi-meet/functions.n
import { hideDialog } from '../../actions';
import logger from '../../logger';
// @ts-ignore
import ConfirmDialog from './ConfirmDialog';
@@ -38,7 +39,9 @@ interface IPageReloadDialogState {
* Shows a warning message and counts down towards the re-load.
*/
class PageReloadDialog extends Component<IPageReloadDialogProps, IPageReloadDialogState> {
_interval?: number;
// @ts-ignore
_interval: IntervalID;
_timeoutSeconds: number;
/**
@@ -102,7 +105,7 @@ class PageReloadDialog extends Component<IPageReloadDialogProps, IPageReloadDial
_onCancel() {
const { dispatch } = this.props;
clearInterval(this._interval ?? 0);
clearInterval(this._interval);
dispatch(appNavigate(undefined));
return true;
@@ -142,7 +145,7 @@ class PageReloadDialog extends Component<IPageReloadDialogProps, IPageReloadDial
_onReloadNow() {
const { dispatch } = this.props;
clearInterval(this._interval ?? 0);
clearInterval(this._interval);
dispatch(reloadNow());
return true;
@@ -197,6 +200,8 @@ function mapStateToProps(state: IReduxState) {
const { fatalError } = state['features/overlay'];
const fatalConnectionError
// @ts-ignore
= connectionError && isFatalJitsiConnectionError(connectionError);
const fatalConfigError = fatalError === configError;

View File

@@ -1,7 +1,7 @@
// @ts-expect-error
// @ts-ignore
import Bourne from '@hapi/bourne';
// eslint-disable-next-line lines-around-comment
// @ts-expect-error
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils/jitsi-local-storage';
import { browser } from '../lib-jitsi-meet';

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import jwtDecode from 'jwt-decode';
import { IReduxState } from '../../app/types';

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import jwtDecode from 'jwt-decode';
import { AnyAction } from 'redux';

View File

@@ -1,9 +1,10 @@
// @ts-expect-error
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils';
import { IStore } from '../../app/types';
import { isOnline } from '../net-info/selectors';
// @ts-ignore
import JitsiMeetJS from './_';
import {
LIB_DID_DISPOSE,

View File

@@ -1,5 +1,4 @@
import { IStateful } from '../app/types';
import { ConnectionFailedError } from '../connection/actions.any';
import { toState } from '../redux/functions';
// @ts-ignore
@@ -92,7 +91,7 @@ export function isFatalJitsiConferenceError(error: Error | string) {
* indicates a fatal {@code JitsiConnection} error, {@code true}; otherwise,
* {@code false}.
*/
export function isFatalJitsiConnectionError(error: Error | string | ConnectionFailedError) {
export function isFatalJitsiConnectionError(error: Error | string) {
if (typeof error !== 'string') {
error = error.name; // eslint-disable-line no-param-reassign
}

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import Bourne from '@hapi/bourne';
import { NativeModules } from 'react-native';

View File

@@ -1,5 +1,6 @@
// Re-export JitsiMeetJS from the library lib-jitsi-meet to (the other features
// of) the project jitsi-meet.
// @ts-ignore
import JitsiMeetJS from './_';
export { JitsiMeetJS as default };

View File

@@ -6,6 +6,7 @@ import { SET_NETWORK_INFO } from '../net-info/actionTypes';
import { PARTICIPANT_LEFT } from '../participants/actionTypes';
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
// @ts-ignore
import JitsiMeetJS from './_';
import { LIB_WILL_INIT } from './actionTypes';
import { disposeLib, initLib } from './actions';

View File

@@ -90,7 +90,7 @@ export default class JitsiMeetLogStorage {
storeLogsCallstats(logEntries: Array<string | any>) {
const conference = getCurrentConference(this.getState());
if (!conference?.isCallstatsEnabled()) {
if (!conference || !conference.isCallstatsEnabled()) {
// Discard the logs if CallStats is not enabled.
return;
}

View File

@@ -1,6 +1,6 @@
import { NativeModules } from 'react-native';
// eslint-disable-next-line lines-around-comment
// @ts-expect-error
// @ts-ignore
import { format } from 'util';
// Some code adapted from https://github.com/houserater/react-native-lumberjack

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import Logger, { getLogger as _getLogger } from '@jitsi/logger';
import _ from 'lodash';

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import Logger from '@jitsi/logger';
import { IStore } from '../../app/types';

View File

@@ -1,2 +1,5 @@
// @ts-ignore
export { default as Audio } from './native/Audio';
// @ts-ignore
export { default as Video } from './native/Video';

View File

@@ -7,6 +7,7 @@ import { IReduxState, IStore } from '../../../../app/types';
import { ASPECT_RATIO_WIDE } from '../../../responsive-ui/constants';
import { storeVideoTransform } from '../../actions';
// @ts-ignore
import styles from './styles';
@@ -124,12 +125,12 @@ class VideoTransform extends Component<IProps, IState> {
/**
* The gesture handler object.
*/
gestureHandlers: any;
gestureHandlers: Object;
/**
* The initial distance of the fingers on pinch start.
*/
initialDistance?: number;
initialDistance: number;
/**
* The initial position of the finger on touch start.
@@ -233,6 +234,8 @@ class VideoTransform extends Component<IProps, IState> {
videoTransformedViewContainerStyles,
style
] }
// @ts-ignore
{ ...this.gestureHandlers.panHandlers }>
<SafeAreaView
edges = { [ 'bottom', 'left' ] }
@@ -486,7 +489,7 @@ class VideoTransform extends Component<IProps, IState> {
* @param {?Object | number} value - The value of the gesture, if any.
* @returns {void}
*/
_onGesture(type: string, value?: any) {
_onGesture(type: string, value: any) {
let transform;
switch (type) {
@@ -597,7 +600,7 @@ class VideoTransform extends Component<IProps, IState> {
this._onGesture('scale', scale);
}
} else if (gestureState.numberActiveTouches === 1
&& isNaN(this.initialDistance ?? 0)
&& isNaN(this.initialDistance)
&& this._didMove(gestureState)) {
// this is a move event
const position = this._getTouchPosition(evt);
@@ -620,9 +623,11 @@ class VideoTransform extends Component<IProps, IState> {
*/
_onPanResponderRelease() {
if (this.lastTap && Date.now() - this.lastTap < TAP_TIMEOUT_MS) {
// @ts-ignore
this._onGesture('press');
}
// @ts-ignore
delete this.initialDistance;
this.initialPosition = {
x: 0,

View File

@@ -185,7 +185,7 @@ class AudioTrack extends Component<IProps> {
* @returns {void}
*/
_attachTrack(track?: ITrack) {
if (!track?.jitsiTrack) {
if (!track || !track.jitsiTrack) {
return;
}

View File

@@ -321,7 +321,7 @@ class Video extends Component<IProps> {
* @returns {void}
*/
_attachTrack(videoTrack?: Partial<ITrack>) {
if (!videoTrack?.jitsiTrack) {
if (!videoTrack || !videoTrack.jitsiTrack) {
return;
}

View File

@@ -1,7 +1,7 @@
import NetInfo from '@react-native-community/netinfo';
import type { NetInfoState, NetInfoSubscription } from '@react-native-community/netinfo';
// eslint-disable-next-line lines-around-comment
// @ts-expect-error
// @ts-ignore
import EventEmitter from 'events';
import { ONLINE_STATE_CHANGED_EVENT } from './events';
@@ -15,7 +15,7 @@ export default class NetworkInfoService extends EventEmitter {
/**
* Stores the native subscription for future cleanup.
*/
_subscription?: NetInfoSubscription;
_subscription: NetInfoSubscription;
/**
* Converts library's structure to {@link NetworkInfo} used by jitsi-meet.
@@ -26,8 +26,10 @@ export default class NetworkInfoService extends EventEmitter {
*/
static _convertNetInfoState(netInfoState: NetInfoState): NetworkInfo {
return {
isOnline: Boolean(netInfoState.isInternetReachable),
// @ts-ignore
isOnline: netInfoState.isInternetReachable,
// @ts-ignore
details: netInfoState.details,
networkType: netInfoState.type
};
@@ -49,7 +51,8 @@ export default class NetworkInfoService extends EventEmitter {
*/
start() {
this._subscription = NetInfo.addEventListener(netInfoState => {
super.emit(ONLINE_STATE_CHANGED_EVENT, NetworkInfoService._convertNetInfoState(netInfoState));
// @ts-ignore
this.emit(ONLINE_STATE_CHANGED_EVENT, NetworkInfoService._convertNetInfoState(netInfoState));
});
}
@@ -61,6 +64,8 @@ export default class NetworkInfoService extends EventEmitter {
stop() {
if (this._subscription) {
this._subscription();
// @ts-ignore
this._subscription = undefined;
}
}

View File

@@ -16,13 +16,13 @@ export type NetworkInfo = {
* If {@link networkType} is {@link NetInfoStateType.cellular} then it may provide the info about the type of
* cellular network.
*/
cellularGeneration?: NetInfoCellularGeneration | null;
cellularGeneration?: NetInfoCellularGeneration;
/**
* Indicates whether or not the connection is expensive.
*/
isConnectionExpensive?: boolean;
} | null;
};
/**
* Tells whether or not the internet is reachable.

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import { getGravatarURL } from '@jitsi/js-utils/avatar';
import { IReduxState, IStore } from '../../app/types';
@@ -200,7 +200,7 @@ export function getVirtualScreenshareParticipantByOwnerId(stateful: IStateful, i
* @returns {string}
*/
export function getNormalizedDisplayName(name: string) {
if (!name?.trim()) {
if (!name || !name.trim()) {
return undefined;
}

View File

@@ -6,7 +6,6 @@ import { IReduxState } from '../../../app/types';
import DialogPortal from '../../../toolbox/components/web/DialogPortal';
import Drawer from '../../../toolbox/components/web/Drawer';
import JitsiPortal from '../../../toolbox/components/web/JitsiPortal';
import { isElementInTheViewport } from '../../ui/functions.web';
import { getContextMenuStyle } from '../functions.web';
/**
@@ -259,16 +258,7 @@ class Popover extends Component<IProps, IState> {
'aria-labelledby': headingId,
'aria-label': !headingId && headingLabel ? headingLabel : undefined
}}
returnFocus = {
// If we return the focus to an element outside the viewport the page will scroll to
// this element which in our case is undesirable and the element is outside of the
// viewport on purpose (to be hidden). For example if we return the focus to the toolbox
// when it is hidden the whole page will move up in order to show the toolbox. This is
// usually followed up with displaying the toolbox (because now it is on focus) but
// because of the animation the whole scenario looks like jumping large video.
isElementInTheViewport
}>
returnFocus = { true }>
{this._renderContent()}
</ReactFocusLock>
</DialogPortal>
@@ -314,8 +304,7 @@ class Popover extends Component<IProps, IState> {
&& !this.props.overflowDrawer
&& this._contextMenuRef
&& this._contextMenuRef.contains
&& !this._contextMenuRef.contains(event.target as Node)
&& !this._containerRef?.current?.contains(event.target as Node)) {
&& !this._contextMenuRef.contains(event.target as Node)) {
this._onHideDialog();
}
}

View File

@@ -12,6 +12,8 @@ import { getToolbarButtons, isToolbarButtonEnabled } from '../../../config/funct
import { withPixelLineHeight } from '../../../styles/functions.web';
import ConnectionStatus from './ConnectionStatus';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import Preview from './Preview';
interface IProps {

View File

@@ -1,2 +1,5 @@
/* eslint-disable lines-around-comment */
// @ts-ignore
export { default as Container } from './native/Container';
// @ts-ignore
export { default as Text } from './native/Text';

View File

@@ -42,7 +42,7 @@ interface IProps {
/**
* Style of the animated view.
*/
style?: StyleType;
style: StyleType;
}
/**

View File

@@ -1,7 +1,7 @@
// @ts-expect-error
// @ts-ignore
import Bourne from '@hapi/bourne';
// eslint-disable-next-line lines-around-comment
// @ts-expect-error
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils';
import md5 from 'js-md5';

View File

@@ -1,3 +1,5 @@
/* eslint-disable lines-around-comment */
import { connect } from 'react-redux';
import { IReduxState } from '../../../../app/types';
@@ -5,7 +7,9 @@ import { translate } from '../../../../base/i18n/functions';
import { IconGear } from '../../../../base/icons/svg';
import AbstractButton, { IProps as AbstractButtonProps } from '../../../../base/toolbox/components/AbstractButton';
import { navigate }
// @ts-ignore
from '../../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
// @ts-ignore
import { screen } from '../../../../mobile/navigation/routes';
import { SETTINGS_ENABLED } from '../../../flags/constants';
import { getFeatureFlag } from '../../../flags/functions';

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import { jitsiLocalStorage } from '@jitsi/js-utils';
import _ from 'lodash';

View File

@@ -1,7 +1,6 @@
import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
import statsEmitter from '../../../connection-indicator/statsEmitter';
import { getLocalParticipant } from '../../participants/functions';
import { isTestModeEnabled } from '../functions';
@@ -11,7 +10,7 @@ import TestHint from './TestHint';
/**
* Defines the TestConnectionInfo's properties.
*/
interface IProps {
type Props = {
/**
* The JitsiConference's connection state. It's the lib-jitsi-meet's event
@@ -21,30 +20,30 @@ interface IProps {
* 'conference.connectionInterrupted'
* 'conference.connectionRestored'.
*/
_conferenceConnectionState: string;
_conferenceConnectionState: string,
/**
* This will be a boolean converted to a string. The value will be 'true'
* once the conference is joined (the XMPP MUC room to be specific).
*/
_conferenceJoinedState: string;
_conferenceJoinedState: string,
/**
* The local participant's ID. Required to be able to observe the local RTP
* stats.
*/
_localUserId: string;
_localUserId: string,
/**
* The local participant's role.
*/
_localUserRole: string;
_localUserRole: string,
/**
* Indicates whether or not the test mode is currently on. Otherwise the
* TestConnectionInfo component will not render.
*/
_testMode: boolean;
_testMode: boolean
}
/**
@@ -65,15 +64,15 @@ type State = {
/**
* The local download RTP bitrate.
*/
download: number;
download: number,
/**
* The local upload RTP bitrate.
*/
upload: number;
};
};
};
upload: number
}
}
}
/**
* The component will expose some of the app state to the jitsi-meet-torture
@@ -82,7 +81,8 @@ type State = {
* this information, but there's no such option on React Native(maybe that's
* a good thing).
*/
class TestConnectionInfo extends Component<IProps, State> {
class TestConnectionInfo extends Component<Props, State> {
_onStatsUpdated: Object => void;
/**
* Initializes new <tt>TestConnectionInfo</tt> instance.
@@ -90,7 +90,7 @@ class TestConnectionInfo extends Component<IProps, State> {
* @param {Object} props - The read-only properties with which the new
* instance is to be initialized.
*/
constructor(props: IProps) {
constructor(props: Props) {
super(props);
this._onStatsUpdated = this._onStatsUpdated.bind(this);
@@ -114,8 +114,7 @@ class TestConnectionInfo extends Component<IProps, State> {
* @returns {void}
* @private
*/
_onStatsUpdated(stats = { bitrate: { download: undefined,
upload: undefined } }) {
_onStatsUpdated(stats = {}) {
this.setState({
stats: {
bitrate: {
@@ -144,7 +143,7 @@ class TestConnectionInfo extends Component<IProps, State> {
* @inheritdoc
* returns {void}
*/
componentDidUpdate(prevProps: IProps) {
componentDidUpdate(prevProps: Props) {
if (prevProps._localUserId !== this.props._localUserId) {
statsEmitter.unsubscribeToClientStats(
prevProps._localUserId, this._onStatsUpdated);
@@ -176,7 +175,7 @@ class TestConnectionInfo extends Component<IProps, State> {
}
return (
<Fragment>
<Fragment accessible = { false } >
<TestHint
id = 'org.jitsi.meet.conference.connectionState'
value = { this.props._conferenceConnectionState } />
@@ -185,7 +184,7 @@ class TestConnectionInfo extends Component<IProps, State> {
value = { this.props._conferenceJoinedState } />
<TestHint
id = 'org.jitsi.meet.conference.grantModeratorAvailable'
value = { 'true' } />
value = { true } />
<TestHint
id = 'org.jitsi.meet.conference.localParticipantRole'
value = { this.props._localUserRole } />
@@ -203,9 +202,9 @@ class TestConnectionInfo extends Component<IProps, State> {
*
* @param {Object} state - The Redux state.
* @private
* @returns {IProps}
* @returns {Props}
*/
function _mapStateToProps(state: IReduxState) {
function _mapStateToProps(state) {
const conferenceJoined
= Boolean(state['features/base/conference'].conference);
const localParticipant = getLocalParticipant(state);
@@ -213,8 +212,8 @@ function _mapStateToProps(state: IReduxState) {
return {
_conferenceConnectionState: state['features/testing'].connectionState,
_conferenceJoinedState: conferenceJoined.toString(),
_localUserId: localParticipant?.id ?? '',
_localUserRole: localParticipant?.role ?? '',
_localUserId: localParticipant?.id,
_localUserRole: localParticipant?.role,
_testMode: isTestModeEnabled(state)
};
}

View File

@@ -1,3 +0,0 @@
import { Component } from 'react';
export default Component;

View File

@@ -43,7 +43,7 @@ export default class ToolboxItem extends AbstractToolboxItem<IProps> {
* @returns {void}
*/
_onKeyPress(event?: React.KeyboardEvent) {
if (event?.key === 'Enter') {
if (event?.key === 'Enter' || event?.key === ' ') {
event.preventDefault();
this.props.onClick();
}

View File

@@ -33,17 +33,17 @@ interface IProps {
/**
* Icon of the button.
*/
icon?: Function;
icon: Function;
/**
* Flag used for disabling the small icon.
*/
iconDisabled?: boolean;
iconDisabled: boolean;
/**
* The ID of the icon button.
*/
iconId?: string;
iconId: string;
/**
* Popover close callback.
@@ -65,11 +65,6 @@ interface IProps {
*/
styles?: Object;
/**
* Whether the trigger for open/ close should be click or hover.
*/
trigger?: 'hover' | 'click';
/**
* Whether or not the popover is visible.
*/
@@ -82,7 +77,7 @@ interface IProps {
* @param {Object} props - Component's props.
* @returns {ReactElement}
*/
export default function ToolboxButtonWithPopup(props: IProps) {
export default function ToolboxButtonWithIconPopup(props: IProps) {
const {
ariaControls,
ariaExpanded,
@@ -96,29 +91,9 @@ export default function ToolboxButtonWithPopup(props: IProps) {
onPopoverOpen,
popoverContent,
styles,
trigger,
visible
} = props;
if (!icon) {
return (
<div
className = 'settings-button-container'
style = { styles }>
<Popover
content = { popoverContent }
headingLabel = { ariaLabel }
onPopoverClose = { onPopoverClose }
onPopoverOpen = { onPopoverOpen }
position = 'top'
trigger = { trigger }
visible = { visible }>
{children}
</Popover>
</div>
);
}
const iconProps: any = {};
if (iconDisabled) {

View File

@@ -1,4 +1,6 @@
import { IReduxState, IStore } from '../../app/types';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { setPictureInPictureEnabled } from '../../mobile/picture-in-picture/functions';
import { showNotification } from '../../notifications/actions';
import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';

View File

@@ -10,6 +10,8 @@ import { setScreenAudioShareState, setScreenshareAudioTrack } from '../../screen
import { isAudioOnlySharing, isScreenVideoShared } from '../../screen-share/functions';
import { toggleScreenshotCaptureSummary } from '../../screenshot-capture/actions';
import { isScreenshotCaptureEnabled } from '../../screenshot-capture/functions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { AudioMixerEffect } from '../../stream-effects/audio-mixer/AudioMixerEffect';
import { getCurrentConference } from '../conference/functions';
import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet';

View File

@@ -1,10 +1,8 @@
import { IStore } from '../../app/types';
import { IStateful } from '../app/types';
import { isMobileBrowser } from '../environment/utils';
import JitsiMeetJS, { JitsiTrackErrors, browser } from '../lib-jitsi-meet';
import JitsiMeetJS from '../lib-jitsi-meet';
import { setAudioMuted } from '../media/actions';
import { MEDIA_TYPE } from '../media/constants';
import { getStartWithAudioMuted } from '../media/functions';
import { toState } from '../redux/functions';
import {
getUserSelectedCameraDeviceId,
@@ -96,10 +94,10 @@ export function createLocalTracksF(options: ITrackOptions = {}, store?: IStore)
}
/**
* Returns an object containing a promise which resolves with the created tracks and the errors resulting from that
* process.
* Returns an object containing a promise which resolves with the created tracks &
* the errors resulting from that process.
*
* @returns {Promise<JitsiLocalTrack[]>}
* @returns {Promise<JitsiLocalTrack>}
*
* @todo Refactor to not use APP.
*/
@@ -108,13 +106,7 @@ export function createPrejoinTracks() {
const initialDevices = [ 'audio' ];
const requestedAudio = true;
let requestedVideo = false;
const { startAudioOnly, startWithVideoMuted } = APP.store.getState()['features/base/settings'];
const startWithAudioMuted = getStartWithAudioMuted(APP.store.getState());
// On Electron there is no permission prompt for granting permissions. That's why we don't need to
// spend much time displaying the overlay screen. If GUM is not resolved within 15 seconds it will
// probably never resolve.
const timeout = browser.isElectron() ? 15000 : 60000;
const { startAudioOnly, startWithAudioMuted, startWithVideoMuted } = APP.store.getState()['features/base/settings'];
// Always get a handle on the audio input device so that we have statistics even if the user joins the
// conference muted. Previous implementation would only acquire the handle when the user first unmuted,
@@ -129,66 +121,62 @@ export function createPrejoinTracks() {
requestedVideo = true;
}
let tryCreateLocalTracks: any = Promise.resolve([]);
let tryCreateLocalTracks;
if (requestedAudio || requestedVideo) {
if (!requestedAudio && !requestedVideo) {
// Resolve with no tracks
tryCreateLocalTracks = Promise.resolve([]);
} else {
tryCreateLocalTracks = createLocalTracksF({
devices: initialDevices,
firePermissionPromptIsShownEvent: true,
timeout
firePermissionPromptIsShownEvent: true
}, APP.store)
.catch(async (err: Error) => {
if (err.name === JitsiTrackErrors.TIMEOUT && !browser.isElectron()) {
errors.audioAndVideoError = err;
.catch((err: Error) => {
if (requestedAudio && requestedVideo) {
return [];
}
// Try audio only...
errors.audioAndVideoError = err;
// Retry with separate gUM calls.
const gUMPromises: any = [];
const tracks: any = [];
return (
createLocalTracksF({
devices: [ 'audio' ],
firePermissionPromptIsShownEvent: true
}));
} else if (requestedAudio && !requestedVideo) {
errors.audioOnlyError = err;
if (requestedAudio) {
gUMPromises.push(createLocalTracksF({
devices: [ MEDIA_TYPE.AUDIO ],
firePermissionPromptIsShownEvent: true,
timeout
}));
}
return [];
} else if (requestedVideo && !requestedAudio) {
errors.videoOnlyError = err;
if (requestedVideo) {
gUMPromises.push(createLocalTracksF({
devices: [ MEDIA_TYPE.VIDEO ],
firePermissionPromptIsShownEvent: true,
timeout
}));
}
const results = await Promise.allSettled(gUMPromises);
let errorMsg;
results.forEach((result, idx) => {
if (result.status === 'fulfilled') {
tracks.push(result.value[0]);
} else {
errorMsg = result.reason;
const isAudio = idx === 0;
logger.error(`${isAudio ? 'Audio' : 'Video'} track creation failed with error ${errorMsg}`);
if (isAudio) {
errors.audioOnlyError = errorMsg;
} else {
errors.videoOnlyError = errorMsg;
return [];
}
}
});
logger.error('Should never happen');
})
.catch((err: Error) => {
// Log this just in case...
if (!requestedAudio) {
logger.error('The impossible just happened', err);
}
errors.audioOnlyError = err;
if (errors.audioOnlyError && errors.videoOnlyError) {
errors.audioAndVideoError = errorMsg;
}
// Try video only...
return requestedVideo
? createLocalTracksF({
devices: [ 'video' ],
firePermissionPromptIsShownEvent: true
})
: [];
})
.catch((err: Error) => {
// Log this just in case...
if (!requestedVideo) {
logger.error('The impossible just happened', err);
}
errors.videoOnlyError = err;
return tracks;
});
return [];
});
}
return {

View File

@@ -138,7 +138,7 @@ function _handleNoDataFromSourceErrors(store: IStore, action: any) {
const track = getTrackByJitsiTrack(getState()['features/base/tracks'], action.track.jitsiTrack);
if (!track?.local) {
if (!track || !track.local) {
return;
}

View File

@@ -2,6 +2,8 @@ import React from 'react';
import { TouchableRipple } from 'react-native-paper';
import Icon from '../../../icons/components/Icon';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import styles from '../../../react/components/native/styles';
import { IIconButtonProps } from '../../../react/types';
import { BUTTON_TYPES } from '../../constants.native';

View File

@@ -5,7 +5,6 @@ import { keyframes } from 'tss-react';
import { makeStyles } from 'tss-react/mui';
import { withPixelLineHeight } from '../../../styles/functions.web';
import { isElementInTheViewport } from '../../functions.web';
import { DialogTransitionContext } from './DialogTransition';
@@ -185,16 +184,7 @@ const BaseDialog = ({
onClick = { onBackdropClick } />
<FocusLock
className = { classes.focusLock }
returnFocus = {
// If we return the focus to an element outside the viewport the page will scroll to
// this element which in our case is undesirable and the element is outside of the
// viewport on purpose (to be hidden). For example if we return the focus to the toolbox
// when it is hidden the whole page will move up in order to show the toolbox. This is
// usually followed up with displaying the toolbox (because now it is on focus) but
// because of the animation the whole scenario looks like jumping large video.
isElementInTheViewport
}>
returnFocus = { true }>
<div
aria-describedby = { description }
aria-labelledby = { title ?? t(titleKey ?? '') }

View File

@@ -70,7 +70,7 @@ const useStyles = makeStyles()(theme => {
'& input[type="checkbox"]': {
appearance: 'none',
backgroundColor: 'transparent',
margin: '3px',
margin: 0,
font: 'inherit',
color: theme.palette.icon03,
width: '18px',

View File

@@ -153,7 +153,7 @@ export interface IDialogTab<P> {
labelKey: string;
name: string;
props?: IObject;
propsUpdateFunction?: (tabState: IObject, newProps: P, tabStates?: (IObject | undefined)[]) => P;
propsUpdateFunction?: (tabState: IObject, newProps: P) => P;
submit?: Function;
}
@@ -257,8 +257,7 @@ const DialogWithTabs = ({
if (tabConfiguration.propsUpdateFunction) {
return tabConfiguration.propsUpdateFunction(
currentTabState ?? {},
tabConfiguration.props ?? {},
tabStates);
tabConfiguration.props ?? {});
}
return { ...currentTabState };

View File

@@ -57,28 +57,3 @@ export const findAncestorByClass = (target: HTMLElement | null, cssClass: string
return findAncestorByClass(target.parentElement, cssClass);
};
/**
* Checks if the passed element is visible in the viewport.
*
* @param {Element} element - The element.
* @returns {boolean}
*/
export function isElementInTheViewport(element?: Element): boolean {
if (!element) {
return false;
}
if (!document.body.contains(element)) {
return false;
}
const { innerHeight, innerWidth } = window;
const { bottom, left, right, top } = element.getBoundingClientRect();
if (bottom <= innerHeight && top >= 0 && left >= 0 && right <= innerWidth) {
return true;
}
return false;
}

View File

@@ -1,4 +1,4 @@
// @ts-expect-error
// @ts-ignore
import Bourne from '@hapi/bourne';
import { reportError } from './helpers';

View File

@@ -6,6 +6,8 @@ import { IStore } from '../app/types';
import { openDialog } from '../base/dialog/actions';
import { refreshCalendar } from './actions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import UpdateCalendarEventDialog from './components/UpdateCalendarEventDialog.native';
import { addLinkToCalendarEntry } from './functions.native';
@@ -38,6 +40,8 @@ export function updateCalendarEvent(eventId: string) {
const roomName = generateRoomWithoutSeparator();
addLinkToCalendarEntry(getState(), eventId, `${defaultUrl}/${roomName}`)
// @ts-ignore
.finally(() => {
dispatch(refreshCalendar(false, false));
});

View File

@@ -40,7 +40,7 @@ function _isDisplayableCalendarEntry(entry: { allDay: boolean; attendees: Object
* @returns {void}
*/
export function _updateCalendarEntries(events: Array<Object>) {
if (!events?.length) {
if (!events || !events.length) {
return;
}

View File

@@ -1,3 +1,4 @@
/* eslint-disable lines-around-comment */
import { IStore } from '../app/types';
import { IStateful } from '../base/app/types';
import { toState } from '../base/redux/functions';
@@ -16,8 +17,11 @@ import {
} from './constants';
import { _updateCalendarEntries } from './functions.web';
import logger from './logger';
// @ts-ignore
import { googleCalendarApi } from './web/googleCalendar';
// @ts-ignore
import { microsoftCalendarApi } from './web/microsoftCalendar';
/* eslint-enable lines-around-comment */
/**
* Determines whether the calendar feature is enabled by the web.

View File

@@ -1,6 +1,6 @@
import { Client } from '@microsoft/microsoft-graph-client';
// eslint-disable-next-line lines-around-comment
// @ts-expect-error
// @ts-ignore
import base64js from 'base64-js';
import { v4 as uuidV4 } from 'uuid';
import { findWindows } from 'windows-iana';

View File

@@ -1,6 +1,10 @@
/* eslint-disable lines-around-comment, max-len */
import { IParticipant } from '../base/participants/types';
import { navigate }
// @ts-ignore
from '../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
// @ts-ignore
import { screen } from '../mobile/navigation/routes';
import { OPEN_CHAT } from './actionTypes';

View File

@@ -1,5 +1,6 @@
/* eslint-disable react/no-multi-comp */
import { Route, useIsFocused } from '@react-navigation/native';
import { useIsFocused } from '@react-navigation/native';
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
@@ -8,7 +9,7 @@ import JitsiScreen from '../../../base/modal/components/JitsiScreen';
import { TabBarLabelCounter } from '../../../mobile/navigation/components/TabBarLabelCounter';
import { closeChat } from '../../actions.native';
import AbstractChat, {
IProps as AbstractProps,
type Props as AbstractProps,
_mapStateToProps
} from '../AbstractChat';
@@ -17,24 +18,24 @@ import MessageContainer from './MessageContainer';
import MessageRecipient from './MessageRecipient';
import styles from './styles';
interface IProps extends AbstractProps {
type Props = AbstractProps & {
/**
* Default prop for navigating between screen components(React Navigation).
*/
navigation: any;
navigation: Object,
/**
* Default prop for navigating between screen components(React Navigation).
*/
route: Route<'', { privateMessageRecipient: { name: string; }; }>;
}
route: Object
};
/**
* Implements a React native component that renders the chat window (modal) of
* the mobile client.
*/
class Chat extends AbstractChat<IProps> {
class Chat extends AbstractChat<Props> {
/**
* Implements React's {@link Component#render()}.
*
@@ -50,16 +51,17 @@ class Chat extends AbstractChat<IProps> {
hasBottomTextInput = { true }
hasTabNavigator = { true }
style = { styles.chatContainer }>
{/* @ts-ignore */}
<MessageContainer messages = { _messages } />
<MessageRecipient privateMessageRecipient = { privateMessageRecipient } />
<ChatInputBar onSend = { this._onSendMessage } />
</JitsiScreen>
);
}
_onSendMessage: (string) => void;
}
export default translate(connect(_mapStateToProps)((props: IProps) => {
export default translate(connect(_mapStateToProps)(props => {
const { _nbUnreadMessages, dispatch, navigation, t } = props;
const unreadMessagesNr = _nbUnreadMessages > 0;
@@ -76,9 +78,7 @@ export default translate(connect(_mapStateToProps)((props: IProps) => {
)
});
return () => {
isFocused && dispatch(closeChat());
};
return () => isFocused && dispatch(closeChat());
}, [ isFocused, _nbUnreadMessages ]);
return (

View File

@@ -1,6 +1,5 @@
import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
import { CHAT_ENABLED } from '../../../base/flags/constants';
import { getFeatureFlag } from '../../../base/flags/functions';
import { translate } from '../../../base/i18n/functions';
@@ -11,23 +10,23 @@ import { screen } from '../../../mobile/navigation/routes';
import { getUnreadPollCount } from '../../../polls/functions';
import { getUnreadCount } from '../../functions';
interface IProps extends AbstractButtonProps {
type Props = AbstractButtonProps & {
/**
* True if the polls feature is disabled.
*/
_isPollsDisabled?: boolean;
_isPollsDisabled: boolean,
/**
* The unread message count.
*/
_unreadMessageCount: number;
}
_unreadMessageCount: number
};
/**
* Implements an {@link AbstractButton} to open the chat screen on mobile.
*/
class ChatButton extends AbstractButton<IProps> {
class ChatButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.chat';
icon = IconMessage;
label = 'toolbar.chat';
@@ -61,9 +60,9 @@ class ChatButton extends AbstractButton<IProps> {
*
* @param {Object} state - The Redux state.
* @param {Object} ownProps - The properties explicitly passed to the component instance.
* @returns {IProps}
* @returns {Props}
*/
function _mapStateToProps(state: IReduxState, ownProps: any) {
function _mapStateToProps(state, ownProps) {
const enabled = getFeatureFlag(state, CHAT_ENABLED, true);
const { disablePolls } = state['features/base/config'];
const { visible = enabled } = ownProps;

View File

@@ -25,6 +25,10 @@ class ChatPrivacyDialog extends AbstractChatPrivacyDialog {
onSubmit = { this._onSendPrivateMessage } />
);
}
_onSendGroupMessage: () => boolean;
_onSendPrivateMessage: () => boolean;
}
export default translate(connect(_mapStateToProps, _mapDispatchToProps)(ChatPrivacyDialog));

View File

@@ -1,65 +1,63 @@
import React from 'react';
import { Text, TouchableHighlight, View, ViewStyle } from 'react-native';
import { Text, TouchableHighlight, View } from 'react-native';
import { connect } from 'react-redux';
import { IReduxState, IStore } from '../../../app/types';
import { translate } from '../../../base/i18n/functions';
import Icon from '../../../base/icons/components/Icon';
import { IconCloseLarge } from '../../../base/icons/svg';
import { ILocalParticipant } from '../../../base/participants/types';
import {
setParams
} from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
import { setLobbyChatActiveState, setPrivateMessageRecipient } from '../../actions.any';
import AbstractMessageRecipient, {
IProps as AbstractProps
type Props as AbstractProps
} from '../AbstractMessageRecipient';
import styles from './styles';
interface IProps extends AbstractProps {
type Props = AbstractProps & {
/**
* The Redux dispatch function.
*/
dispatch: IStore['dispatch'];
dispatch: Function,
/**
* Is lobby messaging active.
*/
isLobbyChatActive: boolean;
isLobbyChatActive: boolean,
/**
* The participant string for lobby chat messaging.
*/
lobbyMessageRecipient?: {
id: string;
name: string;
} | ILocalParticipant;
lobbyMessageRecipient: Object,
/**
* The participant object set for private messaging.
*/
privateMessageRecipient: { name: string; };
}
privateMessageRecipient: Object,
};
/**
* Class to implement the displaying of the recipient of the next message.
*/
class MessageRecipient extends AbstractMessageRecipient<IProps> {
class MessageRecipient extends AbstractMessageRecipient<Props> {
/**
* Constructor of the component.
*
* @param {IProps} props - The props of the component.
* @param {Props} props - The props of the component.
*/
constructor(props: IProps) {
constructor(props: Props) {
super(props);
this._onResetPrivateMessageRecipient = this._onResetPrivateMessageRecipient.bind(this);
this._onResetLobbyMessageRecipient = this._onResetLobbyMessageRecipient.bind(this);
}
_onResetLobbyMessageRecipient: () => void;
/**
* Resets lobby message recipient from state.
*
@@ -71,6 +69,8 @@ class MessageRecipient extends AbstractMessageRecipient<IProps> {
dispatch(setLobbyChatActiveState(false));
}
_onResetPrivateMessageRecipient: () => void;
/**
* Resets private message recipient from state.
*
@@ -102,10 +102,10 @@ class MessageRecipient extends AbstractMessageRecipient<IProps> {
if (isLobbyChatActive) {
return (
<View style = { styles.lobbyMessageRecipientContainer as ViewStyle }>
<View style = { styles.lobbyMessageRecipientContainer }>
<Text style = { styles.messageRecipientText }>
{ t('chat.lobbyChatMessageTo', {
recipient: lobbyMessageRecipient?.name
recipient: lobbyMessageRecipient.name
}) }
</Text>
<TouchableHighlight
@@ -123,7 +123,7 @@ class MessageRecipient extends AbstractMessageRecipient<IProps> {
}
return (
<View style = { styles.messageRecipientContainer as ViewStyle }>
<View style = { styles.messageRecipientContainer }>
<Text style = { styles.messageRecipientText }>
{ t('chat.messageTo', {
recipient: privateMessageRecipient.name
@@ -145,10 +145,9 @@ class MessageRecipient extends AbstractMessageRecipient<IProps> {
* Maps part of the redux state to the props of this component.
*
* @param {Object} state - The Redux state.
* @param {any} _ownProps - Component's own props.
* @returns {IProps}
* @returns {Props}
*/
function _mapStateToProps(state: IReduxState, _ownProps: any) {
function _mapStateToProps(state) {
const { lobbyMessageRecipient, isLobbyChatActive } = state['features/chat'];
return {

View File

@@ -29,11 +29,11 @@ const styles = (theme: Theme) => {
chatMessage: {
display: 'inline-flex',
padding: '12px',
marginRight: '12px',
backgroundColor: theme.palette.ui02,
borderRadius: '4px 12px 12px 12px',
maxWidth: '100%',
marginTop: '4px',
boxSizing: 'border-box' as const,
'&.privatemessage': {
backgroundColor: theme.palette.support05
@@ -62,8 +62,7 @@ const styles = (theme: Theme) => {
replyWrapper: {
display: 'flex',
flexDirection: 'row' as const,
alignItems: 'center',
maxWidth: '100%'
alignItems: 'center'
},
messageContent: {
@@ -127,7 +126,7 @@ class ChatMessage extends AbstractChatMessage<IProps> {
return (
<div
className = { clsx(classes.chatMessageWrapper, type) }
className = { classes.chatMessageWrapper }
id = { this.props.message.messageId }
tabIndex = { -1 }>
<div

View File

@@ -25,11 +25,7 @@ const useStyles = makeStyles()(theme => {
messageGroup: {
display: 'flex',
flexDirection: 'column',
maxWidth: '100%',
'&.remote': {
maxWidth: 'calc(100% - 40px)' // 100% - avatar and margin
}
maxWidth: '100%'
},
groupContainer: {

View File

@@ -23,17 +23,16 @@ function KeyboardAvoider() {
* @returns {void}
*/
function handleViewportResize() {
const { innerWidth, visualViewport } = window;
const { width, height } = visualViewport ?? {};
const { innerWidth, visualViewport: { width, height } } = window;
// Compare the widths to make sure the {@code visualViewport} didn't resize due to zooming.
if (width === innerWidth) {
if (Number(height) < storedHeight) {
setElementHeight(storedHeight - Number(height));
if (height < storedHeight) {
setElementHeight(storedHeight - height);
} else {
setElementHeight(0);
}
setStoredHeight(Number(height));
setStoredHeight(height);
}
}
@@ -41,10 +40,10 @@ function KeyboardAvoider() {
// Call the handler in case the keyboard is open when the {@code KeyboardAvoider} is mounted.
handleViewportResize();
window.visualViewport?.addEventListener('resize', handleViewportResize);
window.visualViewport.addEventListener('resize', handleViewportResize);
return () => {
window.visualViewport?.removeEventListener('resize', handleViewportResize);
window.visualViewport.removeEventListener('resize', handleViewportResize);
};
}, []);

View File

@@ -28,13 +28,6 @@ const useStyles = makeStyles()(theme => {
color: theme.palette.text01
},
text: {
maxWidth: 'calc(100% - 30px)',
overflow: 'hidden',
whiteSpace: 'break-spaces',
wordBreak: 'break-all'
},
iconButton: {
padding: '2px',
@@ -79,7 +72,7 @@ const MessageRecipient = ({
className = { classes.container }
id = 'chat-recipient'
role = 'alert'>
<span className = { classes.text }>
<span>
{t(_isLobbyChatActive ? 'chat.lobbyChatMessageTo' : 'chat.messageTo', {
recipient: _isLobbyChatActive ? _lobbyMessageRecipient : _privateMessageRecipient
})}

View File

@@ -1,7 +1,7 @@
// @ts-expect-error
// @ts-ignore
import aliases from 'react-emoji-render/data/aliases';
// eslint-disable-next-line lines-around-comment
// @ts-expect-error
// @ts-ignore
import emojiAsciiAliases from 'react-emoji-render/data/asciiAliases';
import { IReduxState } from '../app/types';

View File

@@ -1,5 +1,7 @@
import { IStore } from '../app/types';
import { openDialog } from '../base/dialog/actions';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import AlertDialog from '../base/dialog/components/native/AlertDialog';
import { getParticipantDisplayName } from '../base/participants/functions';

View File

@@ -1,15 +1,19 @@
import React, { PureComponent } from 'react';
import { WithTranslation } from 'react-i18next';
import { IReduxState } from '../../app/types';
import isInsecureRoomName from '../../base/util/isInsecureRoomName';
interface IProps extends WithTranslation {
interface IProps {
/**
* True of the label should be visible.
*/
_visible: boolean;
/**
* Function to be used to translate i18n labels.
*/
t: Function;
}
/**

View File

@@ -1,3 +1,5 @@
// @flow
import React, { useCallback } from 'react';
import { TouchableOpacity } from 'react-native';
import { useDispatch } from 'react-redux';
@@ -17,16 +19,16 @@ import {
LabelHitSlop
} from './constants';
interface IProps {
type Props = {
/**
* Creates a function to be invoked when the onPress of the touchables are
* triggered.
*/
createOnPress: Function;
createOnPress: Function
}
const AlwaysOnLabels = ({ createOnPress }: IProps) => {
const AlwaysOnLabels = ({ createOnPress }: Props) => {
const dispatch = useDispatch();
const openHighlightDialogCallback = useCallback(() => dispatch(openHighlightDialog()), [ dispatch ]);

View File

@@ -1,3 +1,5 @@
// @flow
import { useIsFocused } from '@react-navigation/native';
import React, { useEffect } from 'react';
import {
@@ -6,14 +8,12 @@ import {
Platform,
SafeAreaView,
StatusBar,
View,
ViewStyle
View
} from 'react-native';
import { EdgeInsets, withSafeAreaInsets } from 'react-native-safe-area-context';
import { withSafeAreaInsets } from 'react-native-safe-area-context';
import { connect } from 'react-redux';
import { appNavigate } from '../../../app/actions';
import { IReduxState } from '../../../app/types';
import { FULLSCREEN_ENABLED, PIP_ENABLED } from '../../../base/flags/constants';
import { getFeatureFlag } from '../../../base/flags/functions';
import { getParticipantCount } from '../../../base/participants/functions';
@@ -24,7 +24,6 @@ import {
ASPECT_RATIO_NARROW,
ASPECT_RATIO_WIDE
} from '../../../base/responsive-ui/constants';
import { StyleType } from '../../../base/styles/functions.any';
import TestConnectionInfo from '../../../base/testing/components/TestConnectionInfo';
import { isCalendarEnabled } from '../../../calendar-sync/functions.native';
import DisplayNameLabel from '../../../display-name/components/native/DisplayNameLabel';
@@ -64,27 +63,27 @@ import styles from './styles';
/**
* The type of the React {@code Component} props of {@link Conference}.
*/
interface IProps extends AbstractProps {
type Props = AbstractProps & {
/**
* Application's aspect ratio.
*/
_aspectRatio: Symbol;
_aspectRatio: Symbol,
/**
* Whether the audio only is enabled or not.
*/
_audioOnlyEnabled: boolean;
_audioOnlyEnabled: boolean,
/**
* Branding styles for conference.
*/
_brandingStyles: StyleType;
_brandingStyles: Object,
/**
* Whether the calendar feature is enabled or not.
*/
_calendarEnabled: boolean;
_calendarEnabled: boolean,
/**
* The indicator which determines that we are still connecting to the
@@ -92,101 +91,101 @@ interface IProps extends AbstractProps {
* joining the room. If truthy, then an activity/loading indicator will be
* rendered.
*/
_connecting: boolean;
_connecting: boolean,
/**
* Set to {@code true} when the filmstrip is currently visible.
*/
_filmstripVisible: boolean;
_filmstripVisible: boolean,
/**
* The indicator which determines whether fullscreen (immersive) mode is enabled.
*/
_fullscreenEnabled: boolean;
_fullscreenEnabled: boolean,
/**
* The indicator which determines if the conference type is one to one.
*/
_isOneToOneConference: boolean;
_isOneToOneConference: boolean,
/**
* The indicator which determines if the participants pane is open.
*/
_isParticipantsPaneOpen: boolean;
_isParticipantsPaneOpen: boolean,
/**
* The ID of the participant currently on stage (if any).
*/
_largeVideoParticipantId: string;
_largeVideoParticipantId: string,
/**
* Local participant's display name.
*/
_localParticipantDisplayName: string;
_localParticipantDisplayName: string,
/**
* Whether Picture-in-Picture is enabled.
*/
_pictureInPictureEnabled: boolean;
_pictureInPictureEnabled: boolean,
/**
* The indicator which determines whether the UI is reduced (to accommodate
* smaller display areas).
*/
_reducedUI: boolean;
/**
* Indicates if we should auto-knock.
*/
_shouldEnableAutoKnock: boolean;
/**
* Indicates whether the lobby screen should be visible.
*/
_showLobby: boolean;
/**
* Indicates whether the car mode is enabled.
*/
_startCarMode: boolean;
_reducedUI: boolean,
/**
* The indicator which determines whether the Toolbox is visible.
*/
_toolboxVisible: boolean;
_toolboxVisible: boolean,
/**
* Indicates if we should auto-knock.
*/
_shouldEnableAutoKnock: boolean,
/**
* Indicates whether the lobby screen should be visible.
*/
_showLobby: boolean,
/**
* Indicates whether the car mode is enabled.
*/
_startCarMode: boolean,
/**
* The redux {@code dispatch} function.
*/
dispatch: Function;
dispatch: Function,
/**
* Object containing the safe area insets.
*/
insets: EdgeInsets;
insets: Object,
/**
* Default prop for navigating between screen components(React Navigation).
*/
navigation: any;
}
navigation: Object
};
type State = {
/**
* The label that is currently expanded.
*/
visibleExpandedLabel?: string;
};
visibleExpandedLabel: ?string
}
/**
* The conference page of the mobile (i.e. React Native) application.
*/
class Conference extends AbstractConference<IProps, State> {
class Conference extends AbstractConference<Props, State> {
/**
* Timeout ref.
*/
_expandedLabelTimeout: any;
_expandedLabelTimeout: Object;
/**
* Initializes a new Conference instance.
@@ -194,14 +193,14 @@ class Conference extends AbstractConference<IProps, State> {
* @param {Object} props - The read-only properties with which the new
* instance is to be initialized.
*/
constructor(props: IProps) {
constructor(props) {
super(props);
this.state = {
visibleExpandedLabel: undefined
};
this._expandedLabelTimeout = React.createRef<number>();
this._expandedLabelTimeout = React.createRef();
// Bind event handlers so they are only bound once per instance.
this._onClick = this._onClick.bind(this);
@@ -236,7 +235,7 @@ class Conference extends AbstractConference<IProps, State> {
*
* @inheritdoc
*/
componentDidUpdate(prevProps: IProps) {
componentDidUpdate(prevProps) {
const {
_shouldEnableAutoKnock,
_showLobby,
@@ -268,7 +267,7 @@ class Conference extends AbstractConference<IProps, State> {
// Tear handling any hardware button presses for back navigation down.
BackHandler.removeEventListener('hardwareBackPress', this._onHardwareBackPress);
clearTimeout(this._expandedLabelTimeout.current ?? 0);
clearTimeout(this._expandedLabelTimeout.current);
}
/**
@@ -302,6 +301,8 @@ class Conference extends AbstractConference<IProps, State> {
);
}
_onClick: () => void;
/**
* Changes the value of the toolboxVisible state, thus allowing us to switch
* between Toolbox and Filmstrip and change their visibility.
@@ -313,6 +314,8 @@ class Conference extends AbstractConference<IProps, State> {
this._setToolboxVisible(!this.props._toolboxVisible);
}
_onHardwareBackPress: () => boolean;
/**
* Handles a hardware button press for back navigation. Enters Picture-in-Picture mode
* (if supported) or leaves the associated {@code Conference} otherwise.
@@ -337,6 +340,8 @@ class Conference extends AbstractConference<IProps, State> {
return true;
}
_createOnPress: (string) => void;
/**
* Creates a function to be invoked when the onPress of the touchables are
* triggered.
@@ -345,7 +350,7 @@ class Conference extends AbstractConference<IProps, State> {
* triggered.
* @returns {Function}
*/
_createOnPress(label: string) {
_createOnPress(label) {
return () => {
const { visibleExpandedLabel } = this.state;
@@ -429,7 +434,7 @@ class Conference extends AbstractConference<IProps, State> {
<View
pointerEvents = 'box-none'
style = { styles.toolboxAndFilmstripContainer as ViewStyle }>
style = { styles.toolboxAndFilmstripContainer }>
<Captions onPress = { this._onClick } />
@@ -458,17 +463,17 @@ class Conference extends AbstractConference<IProps, State> {
<SafeAreaView
pointerEvents = 'box-none'
style = {
(_toolboxVisible
_toolboxVisible
? styles.titleBarSafeViewColor
: styles.titleBarSafeViewTransparent) as ViewStyle }>
: styles.titleBarSafeViewTransparent }>
<TitleBar _createOnPress = { this._createOnPress } />
</SafeAreaView>
<SafeAreaView
pointerEvents = 'box-none'
style = {
(_toolboxVisible
_toolboxVisible
? [ styles.titleBarSafeViewTransparent, { top: this.props.insets.top + 50 } ]
: styles.titleBarSafeViewTransparent) as ViewStyle
: styles.titleBarSafeViewTransparent
}>
<View
pointerEvents = 'box-none'
@@ -477,7 +482,7 @@ class Conference extends AbstractConference<IProps, State> {
</View>
<View
pointerEvents = 'box-none'
style = { alwaysOnTitleBarStyles as ViewStyle }>
style = { alwaysOnTitleBarStyles }>
{/* eslint-disable-next-line react/jsx-no-bind */}
<AlwaysOnLabels createOnPress = { this._createOnPress } />
</View>
@@ -527,7 +532,7 @@ class Conference extends AbstractConference<IProps, State> {
* @returns {React$Element}
*/
_renderNotificationsContainer() {
const notificationsStyle: ViewStyle = {};
const notificationsStyle = {};
// In the landscape mode (wide) there's problem with notifications being
// shadowed by the filmstrip rendered on the right. This makes the "x"
@@ -554,6 +559,8 @@ class Conference extends AbstractConference<IProps, State> {
);
}
_setToolboxVisible: (boolean) => void;
/**
* Dispatches an action changing the visibility of the {@link Toolbox}.
*
@@ -562,7 +569,7 @@ class Conference extends AbstractConference<IProps, State> {
* {@code Toolbox} or {@code false} to hide it.
* @returns {void}
*/
_setToolboxVisible(visible: boolean) {
_setToolboxVisible(visible) {
this.props.dispatch(setToolboxVisible(visible));
}
}
@@ -571,11 +578,10 @@ class Conference extends AbstractConference<IProps, State> {
* Maps (parts of) the redux state to the associated {@code Conference}'s props.
*
* @param {Object} state - The redux state.
* @param {any} _ownProps - Component's own props.
* @private
* @returns {IProps}
* @returns {Props}
*/
function _mapStateToProps(state: IReduxState, _ownProps: any) {
function _mapStateToProps(state) {
const { isOpen } = state['features/participants-pane'];
const { aspectRatio, reducedUI } = state['features/base/responsive-ui'];
const { backgroundColor } = state['features/dynamic-branding'];
@@ -621,7 +627,7 @@ export default withSafeAreaInsets(connect(_mapStateToProps)(props => {
return () => setPictureInPictureEnabled(false);
}, [ isFocused ]);
return ( // @ts-ignore
return (
<Conference { ...props } />
);
}));

View File

@@ -1,25 +1,26 @@
// @flow
import React from 'react';
import BaseTheme from '../../../base/ui/components/BaseTheme';
import { EXPANDED_LABELS } from './constants';
interface IProps {
type Props = {
/**
* The selected label to show details.
*/
visibleExpandedLabel?: string;
visibleExpandedLabel: ?string
}
const ExpandedLabelPopup = ({ visibleExpandedLabel }: IProps) => {
const ExpandedLabelPopup = ({ visibleExpandedLabel }: Props) => {
if (visibleExpandedLabel) {
const expandedLabel = EXPANDED_LABELS[visibleExpandedLabel as keyof typeof EXPANDED_LABELS];
const expandedLabel = EXPANDED_LABELS[visibleExpandedLabel];
if (expandedLabel) {
const LabelComponent = expandedLabel.component;
const { props, alwaysOn } = expandedLabel;
const LabelComponent = expandedLabel.component || expandedLabel;
const { props, alwaysOn } = expandedLabel || {};
const style = {
top: alwaysOn ? BaseTheme.spacing[6] : BaseTheme.spacing[1]
};

View File

@@ -1,11 +1,13 @@
import { WithTranslation } from 'react-i18next';
// @flow
import { translate } from '../../../base/i18n/functions';
import ExpandedLabel, { IProps as AbstractProps } from '../../../base/label/components/native/ExpandedLabel';
import ExpandedLabel, { Props as AbstractProps } from '../../../base/label/components/native/ExpandedLabel';
import { INSECURE_ROOM_NAME_LABEL_COLOR } from './styles';
type Props = AbstractProps & WithTranslation;
type Props = AbstractProps & {
t: Function
}
/**
* A react {@code Component} that implements an expanded label as tooltip-like

View File

@@ -1,7 +1,8 @@
// @flow
import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../base/i18n/functions';
import { IconWarning } from '../../../base/icons/svg';
import Label from '../../../base/label/components/native/Label';
import AbstractInsecureRoomNameLabel, { _mapStateToProps } from '../AbstractInsecureRoomNameLabel';
@@ -26,4 +27,4 @@ class InsecureRoomNameLabel extends AbstractInsecureRoomNameLabel {
}
}
export default translate(connect(_mapStateToProps)(InsecureRoomNameLabel));
export default connect(_mapStateToProps)(InsecureRoomNameLabel);

View File

@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { TouchableOpacity, View, ViewStyle } from 'react-native';
import { TouchableOpacity, View } from 'react-native';
import TranscribingLabel from '../../../transcribing/components/TranscribingLabel.native';
import VideoQualityLabel from '../../../video-quality/components/VideoQualityLabel.native';
@@ -8,19 +8,19 @@ import InsecureRoomNameLabel from './InsecureRoomNameLabel';
import { LABEL_ID_INSECURE_ROOM_NAME, LABEL_ID_QUALITY, LABEL_ID_TRANSCRIBING, LabelHitSlop } from './constants';
import styles from './styles';
interface IProps {
type Props = {
/**
* Creates a function to be invoked when the onPress of the touchables are
* triggered.
*/
createOnPress: Function;
createOnPress: Function
}
/**
* A container that renders the conference indicators, if any.
*/
class Labels extends Component<IProps> {
class Labels extends Component<Props> {
/**
* Implements React {@code Component}'s render.
@@ -32,7 +32,7 @@ class Labels extends Component<IProps> {
<View pointerEvents = 'box-none'>
<View
pointerEvents = 'box-none'
style = { styles.indicatorContainer as ViewStyle }>
style = { styles.indicatorContainer }>
<TouchableOpacity
hitSlop = { LabelHitSlop }
onPress = {

View File

@@ -20,6 +20,7 @@ import { isInBreakoutRoom } from '../../../breakout-rooms/functions';
import { doInvitePeople } from '../../../invite/actions.native';
import { getInviteOthersControl } from '../../../share-room/functions';
// @ts-ignore
import styles from './styles';

View File

@@ -1,9 +1,11 @@
import { WithTranslation } from 'react-i18next';
// @flow
import { translate } from '../../../base/i18n/functions';
import ExpandedLabel, { IProps as AbstractProps } from '../../../base/label/components/native/ExpandedLabel';
import ExpandedLabel, { Props as AbstractProps } from '../../../base/label/components/native/ExpandedLabel';
type Props = AbstractProps & WithTranslation;
type Props = AbstractProps & {
t: Function
}
/**
* A react {@code Component} that implements an expanded label as tooltip-like

View File

@@ -1,7 +1,6 @@
import React from 'react';
import { useSelector } from 'react-redux';
import { IReduxState } from '../../../app/types';
import { IconRaiseHand } from '../../../base/icons/svg';
import Label from '../../../base/label/components/native/Label';
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
@@ -9,17 +8,17 @@ import BaseTheme from '../../../base/ui/components/BaseTheme.native';
import styles from './styles';
const RaisedHandsCountLabel = () => {
const raisedHandsCount = useSelector((state: IReduxState) =>
const raisedHandsCount = useSelector(state =>
(state['features/base/participants'].raisedHandsQueue || []).length);
return raisedHandsCount > 0 ? (
return raisedHandsCount > 0 && (
<Label
icon = { IconRaiseHand }
iconColor = { BaseTheme.palette.uiBackground }
style = { styles.raisedHandsCountLabel }
text = { `${raisedHandsCount}` }
text = { raisedHandsCount }
textStyle = { styles.raisedHandsCountLabelText } />
) : null;
);
};
export default RaisedHandsCountLabel;

View File

@@ -1,8 +1,9 @@
// @flow
import React from 'react';
import { Text, View, ViewStyle } from 'react-native';
import { Text, View } from 'react-native';
import { connect } from 'react-redux';
import { IReduxState } from '../../../app/types';
import { getConferenceName, getConferenceTimestamp } from '../../../base/conference/functions';
import { CONFERENCE_TIMER_ENABLED, MEETING_NAME_ENABLED } from '../../../base/flags/constants';
import { getFeatureFlag } from '../../../base/flags/functions';
@@ -16,43 +17,44 @@ import ConferenceTimer from '../ConferenceTimer';
import Labels from './Labels';
import styles from './styles';
interface IProps {
/**
* Whether displaying the current conference timer is enabled or not.
*/
_conferenceTimerEnabled: boolean;
type Props = {
/**
* Creates a function to be invoked when the onPress of the touchables are
* triggered.
*/
_createOnPress: Function;
_createOnPress: Function,
/**
* Whether displaying the current conference timer is enabled or not.
*/
_conferenceTimerEnabled: boolean,
/**
* Name of the meeting we're currently in.
*/
_meetingName: string;
_meetingName: string,
/**
* Whether displaying the current meeting name is enabled or not.
*/
_meetingNameEnabled: boolean;
_meetingNameEnabled: boolean,
/**
* True if the navigation bar should be visible.
*/
_visible: boolean;
}
_visible: boolean
};
/**
* Implements a navigation bar component that is rendered on top of the
* conference screen.
*
* @param {IProps} props - The React props passed to this component.
* @param {Props} props - The React props passed to this component.
* @returns {JSX.Element}
*/
const TitleBar = (props: IProps) => {
const TitleBar = (props: Props) => {
const { _visible } = props;
if (!_visible) {
@@ -61,22 +63,22 @@ const TitleBar = (props: IProps) => {
return (
<View
style = { styles.titleBarWrapper as ViewStyle }>
<View style = { styles.pipButtonContainer as ViewStyle }>
style = { styles.titleBarWrapper }>
<View style = { styles.pipButtonContainer }>
<PictureInPictureButton styles = { styles.pipButton } />
</View>
<View
pointerEvents = 'box-none'
style = { styles.roomNameWrapper as ViewStyle }>
style = { styles.roomNameWrapper }>
{
props._conferenceTimerEnabled
&& <View style = { styles.roomTimerView as ViewStyle }>
&& <View style = { styles.roomTimerView }>
<ConferenceTimer textStyle = { styles.roomTimer } />
</View>
}
{
props._meetingNameEnabled
&& <View style = { styles.roomNameView as ViewStyle }>
&& <View style = { styles.roomNameView }>
<Text
numberOfLines = { 1 }
style = { styles.roomName }>
@@ -104,9 +106,9 @@ const TitleBar = (props: IProps) => {
* Maps part of the Redux store to the props of this component.
*
* @param {Object} state - The Redux state.
* @returns {IProps}
* @returns {Props}
*/
function _mapStateToProps(state: IReduxState) {
function _mapStateToProps(state) {
const { hideConferenceTimer, hideConferenceSubject } = state['features/base/config'];
const startTimestamp = getConferenceTimestamp(state);

View File

@@ -1,21 +1,30 @@
/* eslint-disable lines-around-comment */
import React, { useEffect } from 'react';
import { View, ViewStyle } from 'react-native';
import { View } from 'react-native';
import Orientation from 'react-native-orientation-locker';
import { withSafeAreaInsets } from 'react-native-safe-area-context';
import { useDispatch, useSelector } from 'react-redux';
// @ts-ignore
import JitsiScreen from '../../../../base/modal/components/JitsiScreen';
// @ts-ignore
import LoadingIndicator from '../../../../base/react/components/native/LoadingIndicator';
// @ts-ignore
import TintedView from '../../../../base/react/components/native/TintedView';
import { isLocalVideoTrackDesktop } from '../../../../base/tracks/functions.native';
// @ts-ignore
import { setPictureInPictureEnabled } from '../../../../mobile/picture-in-picture/functions';
// @ts-ignore
import { setIsCarmode } from '../../../../video-layout/actions';
// @ts-ignore
import ConferenceTimer from '../../ConferenceTimer';
// @ts-ignore
import { isConnecting } from '../../functions';
import CarModeFooter from './CarModeFooter';
import MicrophoneButton from './MicrophoneButton';
import TitleBar from './TitleBar';
// @ts-ignore
import styles from './styles';
/**
@@ -57,16 +66,17 @@ const CarMode = (): JSX.Element => {
}
<View
pointerEvents = 'box-none'
style = { styles.titleBarSafeViewColor as ViewStyle }>
style = { styles.titleBarSafeViewColor }>
<View
style = { styles.titleBar as ViewStyle }>
style = { styles.titleBar }>
{/* @ts-ignore */}
<TitleBar />
</View>
<ConferenceTimer textStyle = { styles.roomTimer } />
</View>
<View
pointerEvents = 'box-none'
style = { styles.microphoneContainer as ViewStyle }>
style = { styles.microphoneContainer }>
<MicrophoneButton />
</View>
</JitsiScreen>

View File

@@ -1,9 +1,11 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Text, View, ViewStyle } from 'react-native';
import { Text, View } from 'react-native';
import EndMeetingButton from './EndMeetingButton';
import SoundDeviceButton from './SoundDeviceButton';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import styles from './styles';
/**
@@ -17,7 +19,7 @@ const CarModeFooter = (): JSX.Element => {
return (
<View
pointerEvents = 'box-none'
style = { styles.bottomContainer as ViewStyle }>
style = { styles.bottomContainer }>
<Text style = { styles.videoStoppedLabel }>
{ t('carmode.labels.videoStopped') }
</Text>

View File

@@ -8,6 +8,8 @@ import Button from '../../../../base/ui/components/native/Button';
import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
import EndMeetingIcon from './EndMeetingIcon';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import styles from './styles';
/**

View File

@@ -1,5 +1,5 @@
import React, { useCallback, useState } from 'react';
import { TouchableOpacity, View, ViewStyle } from 'react-native';
import { TouchableOpacity, View } from 'react-native';
import { useDispatch, useSelector } from 'react-redux';
import {
@@ -18,6 +18,7 @@ import { isLocalTrackMuted } from '../../../../base/tracks/functions';
import { isAudioMuteButtonDisabled } from '../../../../toolbox/functions.any';
import { muteLocal } from '../../../../video-menu/actions';
// @ts-ignore
import styles from './styles';
const LONG_PRESS = 'long.press';
@@ -76,9 +77,9 @@ const MicrophoneButton = (): JSX.Element | null => {
style = { [
styles.microphoneStyles.container,
!audioMuted && styles.microphoneStyles.unmuted
] as ViewStyle[] }>
] }>
<View
style = { styles.microphoneStyles.iconContainer as ViewStyle }>
style = { styles.microphoneStyles.iconContainer }>
<Icon
src = { audioMuted ? IconMicSlash : IconMic }
style = { styles.microphoneStyles.icon } />

View File

@@ -1,12 +1,15 @@
/* eslint-disable lines-around-comment */
import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';
import { openSheet } from '../../../../base/dialog/actions';
import Button from '../../../../base/ui/components/native/Button';
import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
// @ts-ignore
import AudioRoutePickerDialog from '../../../../mobile/audio-mode/components/AudioRoutePickerDialog';
import AudioIcon from './AudioIcon';
// @ts-ignore
import styles from './styles';
/**

View File

@@ -1,3 +1,5 @@
/* eslint-disable lines-around-comment */
import React from 'react';
import { StyleProp, Text, View, ViewStyle } from 'react-native';
import { connect, useSelector } from 'react-redux';
@@ -8,10 +10,14 @@ import { MEETING_NAME_ENABLED } from '../../../../base/flags/constants';
import { getFeatureFlag } from '../../../../base/flags/functions';
import { JitsiRecordingConstants } from '../../../../base/lib-jitsi-meet';
import { getLocalParticipant } from '../../../../base/participants/functions';
// @ts-ignore
import ConnectionIndicator from '../../../../connection-indicator/components/native/ConnectionIndicator';
// @ts-ignore
import RecordingLabel from '../../../../recording/components/native/RecordingLabel';
// @ts-ignore
import VideoQualityLabel from '../../../../video-quality/components/VideoQualityLabel.native';
// @ts-ignore
import styles from './styles';
@@ -50,7 +56,9 @@ const TitleBar = (props: IProps): JSX.Element => {
<VideoQualityLabel />
</View>
<ConnectionIndicator
// @ts-ignore
iconStyle = { styles.connectionIndicatorIcon }
// @ts-ignore
participantId = { localParticipantId } />
<View style = { styles.headerLabels as StyleProp<ViewStyle> }>
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />

Some files were not shown because too many files have changed in this diff Show More