ref: use getCurrentConference
Try to use the getCurrentConference function wherever the indention is to check for the current conference.
This commit is contained in:
parent
acc41e6d0b
commit
dbd1091364
|
@ -49,6 +49,7 @@ import {
|
||||||
} from './constants';
|
} from './constants';
|
||||||
import {
|
import {
|
||||||
_addLocalTracksToConference,
|
_addLocalTracksToConference,
|
||||||
|
getCurrentConference,
|
||||||
sendLocalParticipant
|
sendLocalParticipant
|
||||||
} from './functions';
|
} from './functions';
|
||||||
|
|
||||||
|
@ -643,9 +644,9 @@ export function setRoom(room: ?string) {
|
||||||
export function setStartMutedPolicy(
|
export function setStartMutedPolicy(
|
||||||
startAudioMuted: boolean, startVideoMuted: boolean) {
|
startAudioMuted: boolean, startVideoMuted: boolean) {
|
||||||
return (dispatch: Dispatch<*>, getState: Function) => {
|
return (dispatch: Dispatch<*>, getState: Function) => {
|
||||||
const { conference } = getState()['features/base/conference'];
|
const conference = getCurrentConference(getState());
|
||||||
|
|
||||||
conference.setStartMutedPolicy({
|
conference && conference.setStartMutedPolicy({
|
||||||
audio: startAudioMuted,
|
audio: startAudioMuted,
|
||||||
video: startVideoMuted
|
video: startVideoMuted
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import type { Dispatch } from 'redux';
|
import type { Dispatch } from 'redux';
|
||||||
|
|
||||||
import { conferenceLeft, conferenceWillLeave } from '../conference';
|
import {
|
||||||
|
conferenceLeft,
|
||||||
|
conferenceWillLeave,
|
||||||
|
getCurrentConference
|
||||||
|
} from '../conference';
|
||||||
import JitsiMeetJS, { JitsiConnectionEvents } from '../lib-jitsi-meet';
|
import JitsiMeetJS, { JitsiConnectionEvents } from '../lib-jitsi-meet';
|
||||||
import { parseStandardURIString } from '../util';
|
import { parseStandardURIString } from '../util';
|
||||||
|
|
||||||
|
@ -306,10 +310,9 @@ function _constructOptions(state) {
|
||||||
export function disconnect() {
|
export function disconnect() {
|
||||||
return (dispatch: Dispatch<*>, getState: Function): Promise<void> => {
|
return (dispatch: Dispatch<*>, getState: Function): Promise<void> => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const { conference, joining } = state['features/base/conference'];
|
|
||||||
|
|
||||||
// The conference we have already joined or are joining.
|
// The conference we have already joined or are joining.
|
||||||
const conference_ = conference || joining;
|
const conference_ = getCurrentConference(state);
|
||||||
|
|
||||||
// Promise which completes when the conference has been left and the
|
// Promise which completes when the conference has been left and the
|
||||||
// connection has been disconnected.
|
// connection has been disconnected.
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
|
||||||
import { CONFERENCE_WILL_JOIN, forEachConference } from '../conference';
|
import {
|
||||||
|
CONFERENCE_WILL_JOIN,
|
||||||
|
forEachConference,
|
||||||
|
getCurrentConference
|
||||||
|
} from '../conference';
|
||||||
import { CALLING, INVITED } from '../../presence-status';
|
import { CALLING, INVITED } from '../../presence-status';
|
||||||
import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
|
import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
|
||||||
import UIEvents from '../../../../service/UI/UIEvents';
|
import UIEvents from '../../../../service/UI/UIEvents';
|
||||||
|
@ -129,11 +133,7 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
* with multiplying thumbnails in the filmstrip.
|
* with multiplying thumbnails in the filmstrip.
|
||||||
*/
|
*/
|
||||||
StateListenerRegistry.register(
|
StateListenerRegistry.register(
|
||||||
/* selector */ state => {
|
/* selector */ state => getCurrentConference(state),
|
||||||
const { conference, joining } = state['features/base/conference'];
|
|
||||||
|
|
||||||
return conference || joining;
|
|
||||||
},
|
|
||||||
/* listener */ (conference, { dispatch, getState }) => {
|
/* listener */ (conference, { dispatch, getState }) => {
|
||||||
for (const p of getState()['features/base/participants']) {
|
for (const p of getState()['features/base/participants']) {
|
||||||
!p.local
|
!p.local
|
||||||
|
|
|
@ -9,7 +9,8 @@ import {
|
||||||
CONFERENCE_JOINED,
|
CONFERENCE_JOINED,
|
||||||
CONFERENCE_LEFT,
|
CONFERENCE_LEFT,
|
||||||
CONFERENCE_WILL_JOIN,
|
CONFERENCE_WILL_JOIN,
|
||||||
SET_AUDIO_ONLY
|
SET_AUDIO_ONLY,
|
||||||
|
getCurrentConference
|
||||||
} from '../../base/conference';
|
} from '../../base/conference';
|
||||||
import { Platform } from '../../base/react';
|
import { Platform } from '../../base/react';
|
||||||
import { MiddlewareRegistry } from '../../base/redux';
|
import { MiddlewareRegistry } from '../../base/redux';
|
||||||
|
@ -50,10 +51,10 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
case CONFERENCE_JOINED:
|
case CONFERENCE_JOINED:
|
||||||
case SET_AUDIO_ONLY: {
|
case SET_AUDIO_ONLY: {
|
||||||
const result = next(action);
|
const result = next(action);
|
||||||
const { audioOnly, conference, joining }
|
const { audioOnly } = store.getState()['features/base/conference'];
|
||||||
= store.getState()['features/base/conference'];
|
const conference = getCurrentConference(store);
|
||||||
|
|
||||||
_setFullScreen(conference || joining ? !audioOnly : false);
|
_setFullScreen(conference ? !audioOnly : false);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -85,9 +86,9 @@ function _onImmersiveChange({ getState }) {
|
||||||
const { appState } = state['features/background'];
|
const { appState } = state['features/background'];
|
||||||
|
|
||||||
if (appState === 'active') {
|
if (appState === 'active') {
|
||||||
const { audioOnly, conference, joining }
|
const { audioOnly } = state['features/base/conference'];
|
||||||
= state['features/base/conference'];
|
const conference = getCurrentConference(state);
|
||||||
const fullScreen = conference || joining ? !audioOnly : false;
|
const fullScreen = conference ? !audioOnly : false;
|
||||||
|
|
||||||
_setFullScreen(fullScreen);
|
_setFullScreen(fullScreen);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue