ref(base/session): create tracks and connect on SET_ROOM
This commit is contained in:
parent
9dbba7b119
commit
160380dac0
|
@ -11,10 +11,8 @@ import {
|
|||
setConfig,
|
||||
storeConfig
|
||||
} from '../base/config';
|
||||
import { connect, setLocationURL } from '../base/connection';
|
||||
import { setLocationURL } from '../base/connection';
|
||||
import { loadConfig } from '../base/lib-jitsi-meet';
|
||||
import { findSessionForLocationURL } from '../base/session';
|
||||
import { createDesiredLocalTracks } from '../base/tracks';
|
||||
import { parseURIString, toURLString } from '../base/util';
|
||||
import { setFatalError } from '../overlay';
|
||||
|
||||
|
@ -97,13 +95,6 @@ export function appNavigate(uri: ?string) {
|
|||
dispatch(setLocationURL(locationURL));
|
||||
dispatch(setConfig(config));
|
||||
dispatch(setRoom(room));
|
||||
|
||||
const session = findSessionForLocationURL(getState(), locationURL);
|
||||
|
||||
if (session && typeof APP === 'undefined') {
|
||||
dispatch(createDesiredLocalTracks());
|
||||
dispatch(connect());
|
||||
}
|
||||
} else {
|
||||
dispatch(loadConfigError(new Error('Config no longer needed!'), locationURL, room));
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { APP_WILL_NAVIGATE } from '../app';
|
||||
import { CONFERENCE_FAILED, CONFERENCE_JOINED, CONFERENCE_LEFT, CONFERENCE_WILL_JOIN } from '../conference';
|
||||
import { CONFERENCE_FAILED, CONFERENCE_JOINED, CONFERENCE_LEFT, CONFERENCE_WILL_JOIN, SET_ROOM } from '../conference';
|
||||
import { CONFIG_WILL_LOAD, LOAD_CONFIG_ERROR } from '../config';
|
||||
import { CONNECTION_DISCONNECTED, CONNECTION_FAILED, CONNECTION_WILL_CONNECT } from '../connection';
|
||||
import { connect, CONNECTION_DISCONNECTED, CONNECTION_FAILED, CONNECTION_WILL_CONNECT } from '../connection';
|
||||
import { MiddlewareRegistry } from '../redux';
|
||||
import { createDesiredLocalTracks } from '../tracks';
|
||||
import { toURLString } from '../util';
|
||||
|
||||
import { createSession, endAllSessions, endSession, sessionFailed, sessionStarted, sessionTerminated } from './actions';
|
||||
|
@ -143,6 +144,17 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case SET_ROOM: {
|
||||
const { locationURL } = getState()['features/base/connection'];
|
||||
const session = findSessionForLocationURL(getState(), locationURL);
|
||||
|
||||
// Web has different logic for creating the local tracks and starting the connection
|
||||
if (session && typeof APP === 'undefined') {
|
||||
dispatch(createDesiredLocalTracks());
|
||||
dispatch(connect());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SESSION_CREATED:
|
||||
case SESSION_STARTED:
|
||||
case SESSION_FAILED:
|
||||
|
|
Loading…
Reference in New Issue