Files
jitsi-meet/react/features/filmstrip/functions.js
Lyubo Marinov dfebd692f3 eslint 4.8.0
ESLint 4.8.0 discovers a lot of error related to formatting. While I
tried to fix as many of them as possible, a portion of them actually go
against our coding style. In such a case, I've disabled the indent rule
which effectively leaves it as it was before ESLint 4.8.0.

Additionally, remove jshint because it's becoming a nuisance with its
lack of understanding of ES2015+.
2017-10-02 18:12:38 -05:00

38 lines
1.1 KiB
JavaScript

/* @flow */
declare var interfaceConfig: Object;
import {
getPinnedParticipant,
getLocalParticipant
} from '../base/participants';
/**
* A selector for determining whether or not remote video thumbnails should be
* displayed in the filmstrip.
*
* @param {Object} state - The full redux state.
* @returns {boolean} - True if remote video thumbnails should be displayed.
*/
export function shouldRemoteVideosBeVisible(state: Object) {
const participants = state['features/base/participants'];
const participantsCount = participants.length;
const shouldShowVideos
= participantsCount > 2
// Always show the filmstrip when there is another participant to show
// and the filmstrip is hovered, or local video is pinned, or the
// toolbar is displayed.
|| (participantsCount > 1
&& (state['features/filmstrip'].hovered
|| state['features/toolbox'].visible
|| getLocalParticipant(state) === getPinnedParticipant(state)))
|| interfaceConfig.filmStripOnly
|| state['features/base/config'].disable1On1Mode;
return Boolean(shouldShowVideos);
}