Kaynağa Gözat

[RN] Naming

master
Lyubo Marinov 8 yıl önce
ebeveyn
işleme
5f64ccb97d

+ 13
- 13
android/README.md Dosyayı Görüntüle

85
 This class encapsulates a high level API in the form of an Android `Activity`
85
 This class encapsulates a high level API in the form of an Android `Activity`
86
 which displays a single `JitsiMeetView`.
86
 which displays a single `JitsiMeetView`.
87
 
87
 
88
-#### getWelcomePageDisabled()
88
+#### getWelcomePageEnabled()
89
 
89
 
90
-See JitsiMeetView.getWelcomePageDisabled.
90
+See JitsiMeetView.getWelcomePageEnabled.
91
 
91
 
92
-#### loadURL(url)
92
+#### loadURL(URL)
93
 
93
 
94
 See JitsiMeetView.loadURL.
94
 See JitsiMeetView.loadURL.
95
 
95
 
96
-#### setWelcomePageDisabled(disabled)
96
+#### setWelcomePageEnabled(boolean)
97
 
97
 
98
-See JitsiMeetView.setWelcomePageDisabled.
98
+See JitsiMeetView.setWelcomePageEnabled.
99
 
99
 
100
 ### JitsiMeetView
100
 ### JitsiMeetView
101
 
101
 
106
 
106
 
107
 Returns the `JitsiMeetViewListener` instance attached to the view.
107
 Returns the `JitsiMeetViewListener` instance attached to the view.
108
 
108
 
109
-#### getWelcomePageDisabled()
109
+#### getWelcomePageEnabled()
110
 
110
 
111
-Returns true if the welcome page is disable,d false if not. If the welcome page
112
-is disabled, a black empty view will be rendered when not in a conference.
111
+Returns true if the Welcome page is enabled; otherwise, false. If false, a black
112
+empty view will be rendered when not in a conference. Defaults to false.
113
 
113
 
114
-#### loadURL(url)
114
+#### loadURL(URL)
115
 
115
 
116
 Loads the given URL and joins the room. If `null` is specified, the welcome page
116
 Loads the given URL and joins the room. If `null` is specified, the welcome page
117
 is displayed instead.
117
 is displayed instead.
121
 Sets the given listener (class implementing the `JitsiMeetViewListener`
121
 Sets the given listener (class implementing the `JitsiMeetViewListener`
122
 interface) on the view.
122
 interface) on the view.
123
 
123
 
124
-#### setWelcomePageDisabled(disabled)
124
+#### setWelcomePageEnabled(boolean)
125
 
125
 
126
-Sets if the welcome page should be disabled or not. See `getWelcomePageDisabled`
127
-for more info.
126
+Sets whether the Welcome page is enabled. See `getWelcomePageEnabled` for more
127
+information.
128
 
128
 
129
-NOTE: This function must be called before `loadURL` for it to take effect.
129
+NOTE: Must be called before `loadURL` for it to take effect.
130
 
130
 
131
 #### onBackPressed()
131
 #### onBackPressed()
132
 
132
 

+ 19
- 4
android/app/src/main/java/org/jitsi/meet/MainActivity.java Dosyayı Görüntüle

16
 
16
 
17
 package org.jitsi.meet;
17
 package org.jitsi.meet;
18
 
18
 
19
+import android.os.Bundle;
20
+
19
 import org.jitsi.meet.sdk.JitsiMeetActivity;
21
 import org.jitsi.meet.sdk.JitsiMeetActivity;
20
 
22
 
21
 /**
23
 /**
25
  * of it. Further attempts at launching the application once it was already
27
  * of it. Further attempts at launching the application once it was already
26
  * launched will result in {@link Activity#onNewIntent(Intent)} being called.
28
  * launched will result in {@link Activity#onNewIntent(Intent)} being called.
27
  *
29
  *
28
- * This {@code Activity} extends {@link JitsiMeetActivity} without adding
29
- * anything to it. It exists to merely keep the React Native CLI working, since
30
- * the latter always tries to launch an {@code Activity} named
31
- * {@code MainActivity} when doing {@code react-native run-android}.
30
+ * This {@code Activity} extends {@link JitsiMeetActivity} to keep the React
31
+ * Native CLI working, since the latter always tries to launch an
32
+ * {@code Activity} named {@code MainActivity} when doing
33
+ * {@code react-native run-android}.
32
  */
34
  */
33
 public class MainActivity extends JitsiMeetActivity {
35
 public class MainActivity extends JitsiMeetActivity {
36
+    /**
37
+     * {@inheritDoc}
38
+     */
39
+    @Override
40
+    protected void onCreate(Bundle savedInstanceState) {
41
+        // As this is the Jitsi Meet app (i.e. not the Jitsi Meet SDK), we do
42
+        // want the Welcome page to be enabled. It defaults to disabled in the
43
+        // SDK at the time of this writing but it is clearer to be explicit
44
+        // about what we want anyway.
45
+        setWelcomePageEnabled(true);
46
+
47
+        super.onCreate(savedInstanceState);
48
+    }
34
 }
49
 }

+ 27
- 12
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java Dosyayı Görüntüle

51
     private JitsiMeetView view;
51
     private JitsiMeetView view;
52
 
52
 
53
     /**
53
     /**
54
-     * See {@JitsiMeetView.getWelcomePageDisabled}.
54
+     * Whether the Welcome page is enabled. The value is used only while
55
+     * {@link #view} equals {@code null}.
55
      */
56
      */
56
-    public boolean getWelcomePageDisabled() {
57
-        return view != null && view.getWelcomePageDisabled();
57
+    private boolean welcomePageEnabled;
58
+
59
+    /**
60
+     *
61
+     * @see JitsiMeetView#getWelcomePageEnabled
62
+     */
63
+    public boolean getWelcomePageEnabled() {
64
+        return view == null ? welcomePageEnabled : view.getWelcomePageEnabled();
58
     }
65
     }
59
 
66
 
60
     /**
67
     /**
67
         view.loadURL(url);
74
         view.loadURL(url);
68
     }
75
     }
69
 
76
 
70
-    /**
71
-     * See {@JitsiMeetView.setWelcomePageDisabled}.
72
-     */
73
-    public void setWelcomePageDisabled(boolean disabled) {
74
-        if (view != null) {
75
-            view.setWelcomePageDisabled(disabled);
76
-        }
77
-    }
78
-
79
     /**
77
     /**
80
      * {@inheritDoc}
78
      * {@inheritDoc}
81
      */
79
      */
115
         super.onCreate(savedInstanceState);
113
         super.onCreate(savedInstanceState);
116
 
114
 
117
         view = new JitsiMeetView(this);
115
         view = new JitsiMeetView(this);
116
+
117
+        // In order to have the desired effect
118
+        // JitsiMeetView#setWelcomePageEnabled(boolean) must be invoked before
119
+        // JitsiMeetView#loadURL(URL).
120
+        view.setWelcomePageEnabled(welcomePageEnabled);
118
         view.loadURL(null);
121
         view.loadURL(null);
119
 
122
 
120
         // In debug mode React needs permission to write over other apps in
123
         // In debug mode React needs permission to write over other apps in
171
 
174
 
172
         JitsiMeetView.onHostResume(this);
175
         JitsiMeetView.onHostResume(this);
173
     }
176
     }
177
+
178
+    /**
179
+     *
180
+     * @see JitsiMeetView#setWelcomePageEnabled
181
+     */
182
+    public void setWelcomePageEnabled(boolean welcomePageEnabled) {
183
+        if (view == null) {
184
+            this.welcomePageEnabled = welcomePageEnabled;
185
+        } else {
186
+            view.setWelcomePageEnabled(welcomePageEnabled);
187
+        }
188
+    }
174
 }
189
 }

+ 22
- 16
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java Dosyayı Görüntüle

59
     private JitsiMeetViewListener listener;
59
     private JitsiMeetViewListener listener;
60
 
60
 
61
     /**
61
     /**
62
-     * Indicates if the welcome page should be disabled or not.
62
+     * React Native root view.
63
      */
63
      */
64
-    private boolean welcomePageDisabled;
64
+    private ReactRootView reactRootView;
65
 
65
 
66
     /**
66
     /**
67
-     * React Native root view.
67
+     * Whether the Welcome page is enabled.
68
      */
68
      */
69
-    private ReactRootView reactRootView;
69
+    private boolean welcomePageEnabled;
70
 
70
 
71
     public JitsiMeetView(@NonNull Context context) {
71
     public JitsiMeetView(@NonNull Context context) {
72
         super(context);
72
         super(context);
94
     /**
94
     /**
95
      * Returns the only instance of this class we currently allow creating.
95
      * Returns the only instance of this class we currently allow creating.
96
      *
96
      *
97
-     * @returns The {@code JitsiMeetView} instance.
97
+     * @return The {@code JitsiMeetView} instance.
98
      */
98
      */
99
     public static JitsiMeetView getInstance() {
99
     public static JitsiMeetView getInstance() {
100
         return instance;
100
         return instance;
103
     /**
103
     /**
104
      * Gets the {@link JitsiMeetViewListener} set on this {@code JitsiMeetView}.
104
      * Gets the {@link JitsiMeetViewListener} set on this {@code JitsiMeetView}.
105
      *
105
      *
106
-     * @returns The {@code JitsiMeetViewListener} set on this
106
+     * @return The {@code JitsiMeetViewListener} set on this
107
      * {@code JitsiMeetView}.
107
      * {@code JitsiMeetView}.
108
      */
108
      */
109
     public JitsiMeetViewListener getListener() {
109
     public JitsiMeetViewListener getListener() {
111
     }
111
     }
112
 
112
 
113
     /**
113
     /**
114
-     * @return - true if the welcome page is disabled, false if not.
114
+     * Gets whether the Welcome page is enabled. If {@code true}, the Welcome
115
+     * page is rendered when this {@code JitsiMeetView} is not at a URL
116
+     * identifying a Jitsi Meet conference/room.
117
+     *
118
+     * @return {@true} if the Welcome page is enabled; otherwise, {@code false}.
115
      */
119
      */
116
-    public boolean getWelcomePageDisabled() {
117
-        return welcomePageDisabled;
120
+    public boolean getWelcomePageEnabled() {
121
+        return welcomePageEnabled;
118
     }
122
     }
119
 
123
 
120
     /**
124
     /**
153
     public void loadURL(@Nullable URL url) {
157
     public void loadURL(@Nullable URL url) {
154
         Bundle props = new Bundle();
158
         Bundle props = new Bundle();
155
 
159
 
160
+        // url
156
         if (url != null) {
161
         if (url != null) {
157
             props.putString("url", url.toString());
162
             props.putString("url", url.toString());
158
         }
163
         }
159
-
160
-        props.putBoolean("disableWelcomePage", welcomePageDisabled);
164
+        // welcomePageEnabled
165
+        props.putBoolean("welcomePageEnabled", welcomePageEnabled);
161
 
166
 
162
         // TODO: ReactRootView#setAppProperties is only available on React
167
         // TODO: ReactRootView#setAppProperties is only available on React
163
         // Native 0.45, so destroy the current root view and create a new one.
168
         // Native 0.45, so destroy the current root view and create a new one.
185
     }
190
     }
186
 
191
 
187
     /**
192
     /**
188
-     * Sets if the welcome page should be enabled or not. Must be called before calling loadURL or
189
-     * it won't take effect.
193
+     * Sets whether the Welcome page is enabled. Must be called before
194
+     * {@link #loadURL(URL)} for it to take effect.
190
      *
195
      *
191
-     * @param disabled - set to true for disabling the welcome page, false not to do so.
196
+     * @param welcomePageEnabled {@code true} to enable the Welcome page;
197
+     * otherwise, {@code false}.
192
      */
198
      */
193
-    public void setWelcomePageDisabled(boolean disabled) {
194
-        welcomePageDisabled = disabled;
199
+    public void setWelcomePageEnabled(boolean welcomePageEnabled) {
200
+        this.welcomePageEnabled = welcomePageEnabled;
195
     }
201
     }
196
 
202
 
197
     /**
203
     /**

+ 6
- 9
ios/README.md Dosyayı Görüntüle

34
 
34
 
35
 #### delegate
35
 #### delegate
36
 
36
 
37
-Property for getting / setting the delegate (instance of `JitsiMeetViewDelegate`
38
-in the view.
37
+Property for getting / setting the `JitsiMeetViewDelegate` on `JitsiMeetView`.
39
 
38
 
40
-#### disableWelcomePage
39
+#### welcomePageEnabled
41
 
40
 
42
-Property for setting the welcome page as disabled (or not). It default to NO, so
43
-a welcome page would be shown. When the welcome page is set to disabled, an
44
-empty black view is rendered.
41
+Property for getting / setting whether the Welcome page is enabled. If NO, a
42
+black empty view will be rendered when not in a conference. Defaults to NO.
45
 
43
 
46
-NOTE: This property must be set before calling `loadURL` in order for it to take
47
-effect.
44
+NOTE: Must be set before calling `loadURL` for it to take effect.
48
 
45
 
49
-#### loadURL(url)
46
+#### loadURL(URL)
50
 
47
 
51
 ```objc
48
 ```objc
52
 [meetView loadURL:[NSURL URLWithString:@"https://meet.jit.si/test123"]];
49
 [meetView loadURL:[NSURL URLWithString:@"https://meet.jit.si/test123"]];

+ 5
- 0
ios/app/src/ViewController.m Dosyayı Görüntüle

32
     JitsiMeetView *view = (JitsiMeetView *) self.view;
32
     JitsiMeetView *view = (JitsiMeetView *) self.view;
33
 
33
 
34
     view.delegate = self;
34
     view.delegate = self;
35
+    // As this is the Jitsi Meet app (i.e. not the Jitsi Meet SDK), we do
36
+    // want the Welcome page to be enabled. It defaults to disabled in the
37
+    // SDK at the time of this writing but it is clearer to be explicit
38
+    // about what we want anyway.
39
+    view.welcomePageEnabled = YES;
35
     [view loadURL:nil];
40
     [view loadURL:nil];
36
 }
41
 }
37
 
42
 

+ 2
- 1
ios/sdk/src/JitsiMeetView.h Dosyayı Görüntüle

22
 @interface JitsiMeetView : UIView
22
 @interface JitsiMeetView : UIView
23
 
23
 
24
 @property (nonatomic, weak, nullable) id<JitsiMeetViewDelegate> delegate;
24
 @property (nonatomic, weak, nullable) id<JitsiMeetViewDelegate> delegate;
25
-@property (nonatomic) BOOL disableWelcomePage;
25
+
26
+@property (nonatomic) BOOL welcomePageEnabled;
26
 
27
 
27
 +    (BOOL)application:(UIApplication *)application
28
 +    (BOOL)application:(UIApplication *)application
28
   continueUserActivity:(NSUserActivity *)userActivity
29
   continueUserActivity:(NSUserActivity *)userActivity

+ 3
- 2
ios/sdk/src/JitsiMeetView.m Dosyayı Görüntüle

108
 - (void)loadURL:(NSURL *)url {
108
 - (void)loadURL:(NSURL *)url {
109
     NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
109
     NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
110
 
110
 
111
+    // url
111
     if (url) {
112
     if (url) {
112
         [props setObject:url.absoluteString forKey:@"url"];
113
         [props setObject:url.absoluteString forKey:@"url"];
113
     }
114
     }
114
-
115
-    [props setObject:@(self.disableWelcomePage) forKey:@"disableWelcomePage"];
115
+    // welcomePageEnabled
116
+    [props setObject:@(self.welcomePageEnabled) forKey:@"welcomePageEnabled"];
116
 
117
 
117
     if (rootView == nil) {
118
     if (rootView == nil) {
118
         rootView
119
         rootView

+ 2
- 15
react/features/app/actionTypes.js Dosyayı Görüntüle

1
 /**
1
 /**
2
- * The type of (Redux) action which configures if the welcome page should be
3
- * disabled or not.
4
- *
5
- * {
6
- *     type: APP_SET_WELCOME_PAGE_DISABLED,
7
- *     app: App,
8
- *     disabled: boolean
9
- * }
10
- */
11
-export const APP_SET_WELCOME_PAGE_DISABLED
12
-    = Symbol('APP_SET_WELCOME_PAGE_DISABLED');
13
-
14
-/**
15
- * The type of (Redux) action which signals that a specific App will mount (in
2
+ * The type of (redux) action which signals that a specific App will mount (in
16
  * React terms).
3
  * React terms).
17
  *
4
  *
18
  * {
5
  * {
23
 export const APP_WILL_MOUNT = Symbol('APP_WILL_MOUNT');
10
 export const APP_WILL_MOUNT = Symbol('APP_WILL_MOUNT');
24
 
11
 
25
 /**
12
 /**
26
- * The type of (Redux) action which signals that a specific App will unmount (in
13
+ * The type of (redux) action which signals that a specific App will unmount (in
27
  * React terms).
14
  * React terms).
28
  *
15
  *
29
  * {
16
  * {

+ 1
- 25
react/features/app/actions.js Dosyayı Görüntüle

3
 import { setConfig } from '../base/config';
3
 import { setConfig } from '../base/config';
4
 import { loadConfig } from '../base/lib-jitsi-meet';
4
 import { loadConfig } from '../base/lib-jitsi-meet';
5
 
5
 
6
-import {
7
-    APP_SET_WELCOME_PAGE_DISABLED,
8
-    APP_WILL_MOUNT,
9
-    APP_WILL_UNMOUNT
10
-} from './actionTypes';
6
+import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
11
 import { _getRouteToRender, _parseURIString } from './functions';
7
 import { _getRouteToRender, _parseURIString } from './functions';
12
 
8
 
13
 declare var APP: Object;
9
 declare var APP: Object;
160
     _appNavigateToMandatoryLocation(dispatch, getState, location);
156
     _appNavigateToMandatoryLocation(dispatch, getState, location);
161
 }
157
 }
162
 
158
 
163
-/**
164
- * Configures the welcome page display for this app.
165
- *
166
- * @param {App} app - The App being configured.
167
- * @param {boolean} disabled - Set to true if the welcome page should be
168
- * disabled, false if it shouldn't.
169
- * @returns {{
170
- *     type: APP_SET_WELCOME_PAGE_DISABLED,
171
- *     app: App,
172
- *     disabled: boolean
173
- * }}
174
- */
175
-export function appSetWelcomePageDisabled(app, disabled) {
176
-    return {
177
-        type: APP_SET_WELCOME_PAGE_DISABLED,
178
-        app,
179
-        disabled
180
-    };
181
-}
182
-
183
 /**
159
 /**
184
  * Signals that a specific App will mount (in the terms of React).
160
  * Signals that a specific App will mount (in the terms of React).
185
  *
161
  *

+ 22
- 18
react/features/app/components/AbstractApp.js Dosyayı Görüntüle

21
 declare var APP: Object;
21
 declare var APP: Object;
22
 
22
 
23
 /**
23
 /**
24
- * Default URL to be loaded if no other was specified using props.
24
+ * The default URL to open if no other was specified to {@code AbstractApp}
25
+ * via props.
25
  */
26
  */
26
 const DEFAULT_URL = 'https://meet.jit.si';
27
 const DEFAULT_URL = 'https://meet.jit.si';
27
 
28
 
38
      */
39
      */
39
     static propTypes = {
40
     static propTypes = {
40
         /**
41
         /**
41
-         * Default URL to be loaded by the app when not in any room.
42
+         * The default URL {@code AbstractApp} is to open when not in any
43
+         * conference/room.
42
          */
44
          */
43
-        defaultUrl: React.PropTypes.string,
45
+        defaultURL: React.PropTypes.string,
44
 
46
 
45
         /**
47
         /**
46
          * (Optional) Redux store for this app.
48
          * (Optional) Redux store for this app.
203
      * @protected
205
      * @protected
204
      */
206
      */
205
     _createElement(component, props) {
207
     _createElement(component, props) {
206
-        /* eslint-disable no-unused-vars, lines-around-comment */
208
+        /* eslint-disable no-unused-vars */
209
+
207
         const {
210
         const {
208
-            // The defaultUrl property was introduced to be consumed entirely by
209
-            // AbstractApp.
210
-            defaultUrl,
211
             // Don't propagate the dispatch and store props because they usually
211
             // Don't propagate the dispatch and store props because they usually
212
             // come from react-redux and programmers don't really expect them to
212
             // come from react-redux and programmers don't really expect them to
213
             // be inherited but rather explicitly connected.
213
             // be inherited but rather explicitly connected.
214
             dispatch, // eslint-disable-line react/prop-types
214
             dispatch, // eslint-disable-line react/prop-types
215
             store,
215
             store,
216
-            // The url property was introduced to be consumed entirely by
217
-            // AbstractApp.
216
+
217
+            // The following props were introduced to be consumed entirely by
218
+            // AbstractApp:
219
+            defaultURL,
218
             url,
220
             url,
221
+
219
             // The remaining props, if any, are considered suitable for
222
             // The remaining props, if any, are considered suitable for
220
             // propagation to the children of this Component.
223
             // propagation to the children of this Component.
221
             ...thisProps
224
             ...thisProps
222
         } = this.props;
225
         } = this.props;
223
-        /* eslint-enable no-unused-vars, lines-around-comment */
224
 
226
 
225
-        // eslint-disable-next-line object-property-newline
226
-        return React.createElement(component, { ...thisProps, ...props });
227
+        /* eslint-enable no-unused-vars */
228
+
229
+        return React.createElement(component, {
230
+            ...thisProps,
231
+            ...props
232
+        });
227
     }
233
     }
228
 
234
 
229
     /**
235
     /**
276
             }
282
             }
277
         }
283
         }
278
 
284
 
279
-        return this.props.defaultUrl || DEFAULT_URL;
285
+        return this.props.defaultURL || DEFAULT_URL;
280
     }
286
     }
281
 
287
 
282
     /**
288
     /**
350
         // role of Router is now this AbstractApp, provide its nextState.
356
         // role of Router is now this AbstractApp, provide its nextState.
351
         // (2) A replace function would be provided to the Route in case it
357
         // (2) A replace function would be provided to the Route in case it
352
         // chose to redirect to another path.
358
         // chose to redirect to another path.
353
-        this._onRouteEnter(route, nextState, pathname => {
359
+        route && this._onRouteEnter(route, nextState, pathname => {
354
             this._openURL(pathname);
360
             this._openURL(pathname);
355
 
361
 
356
             // Do not proceed with the route because it chose to redirect to
362
             // Do not proceed with the route because it chose to redirect to
370
      */
376
      */
371
     _onRouteEnter(route, ...args) {
377
     _onRouteEnter(route, ...args) {
372
         // Notify the route that it is about to be entered.
378
         // Notify the route that it is about to be entered.
373
-        const onEnter = route && route.onEnter;
379
+        const { onEnter } = route;
374
 
380
 
375
-        if (typeof onEnter === 'function') {
376
-            onEnter(...args);
377
-        }
381
+        typeof onEnter === 'function' && onEnter(...args);
378
     }
382
     }
379
 
383
 
380
     /**
384
     /**

+ 4
- 11
react/features/app/components/App.native.js Dosyayı Görüntüle

12
 import '../../mobile/wake-lock';
12
 import '../../mobile/wake-lock';
13
 
13
 
14
 import { AbstractApp } from './AbstractApp';
14
 import { AbstractApp } from './AbstractApp';
15
-import { appSetWelcomePageDisabled } from '../actions';
16
 
15
 
17
 /**
16
 /**
18
  * Root application component.
17
  * Root application component.
29
         ...AbstractApp.propTypes,
28
         ...AbstractApp.propTypes,
30
 
29
 
31
         /**
30
         /**
32
-         * Indicates if the welcome page should be shown when not in a
33
-         * conference.
31
+         * Whether the Welcome page is enabled. If {@code true}, the Welcome
32
+         * page is rendered when the {@link App} is not at a location (URL)
33
+         * identifying a Jitsi Meet conference/room.
34
          */
34
          */
35
-        disableWelcomePage: React.PropTypes.bool
35
+        welcomePageEnabled: React.PropTypes.bool
36
     };
36
     };
37
 
37
 
38
     /**
38
     /**
66
         super.componentWillMount();
66
         super.componentWillMount();
67
 
67
 
68
         Linking.addEventListener('url', this._onLinkingURL);
68
         Linking.addEventListener('url', this._onLinkingURL);
69
-
70
-        // Store the desire to use the welcome page or not in the Redux store.
71
-        const dispatch = this._getStore().dispatch;
72
-
73
-        dispatch(
74
-            appSetWelcomePageDisabled(
75
-                this, Boolean(this.props.disableWelcomePage)));
76
     }
69
     }
77
 
70
 
78
     /**
71
     /**

+ 11
- 4
react/features/app/functions.native.js Dosyayı Görüntüle

142
         = typeof stateOrGetState === 'function'
142
         = typeof stateOrGetState === 'function'
143
             ? stateOrGetState()
143
             ? stateOrGetState()
144
             : stateOrGetState;
144
             : stateOrGetState;
145
-    const { disableWelcomePage } = state['features/app'];
146
     const { room } = state['features/base/conference'];
145
     const { room } = state['features/base/conference'];
147
-    const component = isRoomValid(room) ? Conference : WelcomePage;
146
+    let component;
148
 
147
 
149
-    if (component === WelcomePage && disableWelcomePage) {
150
-        return null;
148
+    if (isRoomValid(room)) {
149
+        component = Conference;
150
+    } else {
151
+        // The value of the App prop welcomePageEnabled was stored in redux in
152
+        // saghul's PR. But I removed the redux state, action, action type, etc.
153
+        // because I didn't like the name. We are not using the prop is a
154
+        // React-ive way anyway so it's all the same difference.
155
+        const { app } = state['features/app'];
156
+
157
+        component = app && app.props.welcomePageEnabled ? WelcomePage : null;
151
     }
158
     }
152
 
159
 
153
     return RouteRegistry.getRouteByComponent(component);
160
     return RouteRegistry.getRouteByComponent(component);

+ 7
- 16
react/features/app/reducer.js Dosyayı Görüntüle

1
 import { ReducerRegistry } from '../base/redux';
1
 import { ReducerRegistry } from '../base/redux';
2
 
2
 
3
-import {
4
-    APP_SET_WELCOME_PAGE_DISABLED,
5
-    APP_WILL_MOUNT,
6
-    APP_WILL_UNMOUNT
7
-} from './actionTypes';
3
+import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
8
 
4
 
9
 ReducerRegistry.register('features/app', (state = {}, action) => {
5
 ReducerRegistry.register('features/app', (state = {}, action) => {
10
     switch (action.type) {
6
     switch (action.type) {
11
-    case APP_SET_WELCOME_PAGE_DISABLED:
12
-        if (state.app === action.app) {
13
-            return {
14
-                ...state,
15
-                disableWelcomePage: action.disabled
16
-            };
17
-        }
18
-        break;
19
-    case APP_WILL_MOUNT:
20
-        if (state.app !== action.app) {
7
+    case APP_WILL_MOUNT: {
8
+        const { app } = action;
9
+
10
+        if (state.app !== app) {
21
             return {
11
             return {
22
                 ...state,
12
                 ...state,
23
 
13
 
27
                  *
17
                  *
28
                  * @type {App}
18
                  * @type {App}
29
                  */
19
                  */
30
-                app: action.app
20
+                app
31
             };
21
             };
32
         }
22
         }
33
         break;
23
         break;
24
+    }
34
 
25
 
35
     case APP_WILL_UNMOUNT:
26
     case APP_WILL_UNMOUNT:
36
         if (state.app === action.app) {
27
         if (state.app === action.app) {

+ 27
- 14
react/index.native.js Dosyayı Görüntüle

13
  */
13
  */
14
 class Root extends Component {
14
 class Root extends Component {
15
     /**
15
     /**
16
-     * Root component's property types.
16
+     * {@code Root} component's property types.
17
      *
17
      *
18
      * @static
18
      * @static
19
      */
19
      */
20
     static propTypes = {
20
     static propTypes = {
21
         /**
21
         /**
22
-         * Indicates if the welcome page should be shown when not in a
23
-         * conference.
22
+         * The URL, if any, with which the app was launched.
24
          */
23
          */
25
-        disableWelcomePage: React.PropTypes.bool,
24
+        url: React.PropTypes.string,
26
 
25
 
27
         /**
26
         /**
28
-         * The URL, if any, with which the app was launched.
27
+         * Whether the Welcome page is enabled. If {@code true}, the Welcome
28
+         * page is rendered when the {@link App} is not at a location (URL)
29
+         * identifying a Jitsi Meet conference/room.
29
          */
30
          */
30
-        url: React.PropTypes.string
31
+        welcomePageEnabled: React.PropTypes.bool
31
     };
32
     };
32
 
33
 
33
     /**
34
     /**
34
-     * Initializes a new Root instance.
35
+     * Initializes a new {@code Root} instance.
35
      *
36
      *
36
      * @param {Object} props - The read-only properties with which the new
37
      * @param {Object} props - The read-only properties with which the new
37
      * instance is to be initialized.
38
      * instance is to be initialized.
42
         /**
43
         /**
43
          * The initial state of this Component.
44
          * The initial state of this Component.
44
          *
45
          *
45
-         * @type {{url: string}}
46
+         * @type {{
47
+         *     url: string
48
+         * }}
46
          */
49
          */
47
         this.state = {
50
         this.state = {
48
             /**
51
             /**
74
      * @returns {ReactElement}
77
      * @returns {ReactElement}
75
      */
78
      */
76
     render() {
79
     render() {
77
-        // XXX We don't render the App component until we get the initial URL,
78
-        // either it's null or some other non-null defined value;
79
-        if (typeof this.state.url === 'undefined') {
80
+        const { url } = this.state;
81
+
82
+        // XXX We don't render the App component until we get the initial URL.
83
+        // Either it's null or some other non-null defined value.
84
+        if (typeof url === 'undefined') {
80
             return null;
85
             return null;
81
         }
86
         }
82
 
87
 
88
+        const {
89
+            // The following props are forked in state:
90
+            url: _, // eslint-disable-line no-unused-vars
91
+
92
+            // The remaining props are passed through to App.
93
+            ...props
94
+        } = this.props;
95
+
83
         return (
96
         return (
84
             <App
97
             <App
85
-                disableWelcomePage = { this.props.disableWelcomePage }
86
-                url = { this.state.url } />
98
+                { ...props }
99
+                url = { url } />
87
         );
100
         );
88
     }
101
     }
89
 }
102
 }
90
 
103
 
91
-// Register the main Component.
104
+// Register the main/root Component.
92
 AppRegistry.registerComponent('App', () => Root);
105
 AppRegistry.registerComponent('App', () => Root);

+ 1
- 1
react/index.web.js Dosyayı Görüntüle

18
     APP.connectionTimes['document.ready'] = now;
18
     APP.connectionTimes['document.ready'] = now;
19
     logger.log('(TIME) document ready:\t', now);
19
     logger.log('(TIME) document ready:\t', now);
20
 
20
 
21
-    // Render the main Component.
21
+    // Render the main/root Component.
22
     ReactDOM.render(<App />, document.getElementById('react'));
22
     ReactDOM.render(<App />, document.getElementById('react'));
23
 });
23
 });
24
 
24
 

Loading…
İptal
Kaydet