|
|
@@ -8,10 +8,7 @@ import { compose, createStore } from 'redux';
|
|
8
|
8
|
import Thunk from 'redux-thunk';
|
|
9
|
9
|
|
|
10
|
10
|
import { i18next } from '../../base/i18n';
|
|
11
|
|
-import {
|
|
12
|
|
- localParticipantJoined,
|
|
13
|
|
- localParticipantLeft
|
|
14
|
|
-} from '../../base/participants';
|
|
|
11
|
+import { localParticipantLeft } from '../../base/participants';
|
|
15
|
12
|
import { Fragment, RouteRegistry } from '../../base/react';
|
|
16
|
13
|
import { MiddlewareRegistry, ReducerRegistry } from '../../base/redux';
|
|
17
|
14
|
import { SoundCollection } from '../../base/sounds';
|
|
|
@@ -126,24 +123,10 @@ export class AbstractApp extends Component {
|
|
126
|
123
|
*/
|
|
127
|
124
|
componentWillMount() {
|
|
128
|
125
|
this._init.then(() => {
|
|
129
|
|
- const { dispatch, getState } = this._getStore();
|
|
|
126
|
+ const { dispatch } = this._getStore();
|
|
130
|
127
|
|
|
131
|
128
|
dispatch(appWillMount(this));
|
|
132
|
129
|
|
|
133
|
|
- // FIXME I believe it makes more sense for a middleware to dispatch
|
|
134
|
|
- // localParticipantJoined on APP_WILL_MOUNT because the order of
|
|
135
|
|
- // actions is important, not the call site. Moreover, we've got
|
|
136
|
|
- // localParticipant business logic in the React Component
|
|
137
|
|
- // (i.e. UI) AbstractApp now.
|
|
138
|
|
-
|
|
139
|
|
- const settings = getState()['features/base/settings'];
|
|
140
|
|
- const localParticipant = {
|
|
141
|
|
- avatarID: settings.avatarID,
|
|
142
|
|
- avatarURL: settings.avatarURL,
|
|
143
|
|
- email: settings.email,
|
|
144
|
|
- name: settings.displayName
|
|
145
|
|
- };
|
|
146
|
|
-
|
|
147
|
130
|
// We set the initialized state here and not in the contructor to
|
|
148
|
131
|
// make sure that {@code componentWillMount} gets invoked before
|
|
149
|
132
|
// the app tries to render the actual app content.
|
|
|
@@ -151,8 +134,6 @@ export class AbstractApp extends Component {
|
|
151
|
134
|
appAsyncInitialized: true
|
|
152
|
135
|
});
|
|
153
|
136
|
|
|
154
|
|
- dispatch(localParticipantJoined(localParticipant));
|
|
155
|
|
-
|
|
156
|
137
|
// If a URL was explicitly specified to this React Component,
|
|
157
|
138
|
// then open it; otherwise, use a default.
|
|
158
|
139
|
this._openURL(toURLString(this.props.url) || this._getDefaultURL());
|