Quellcode durchsuchen

Fix reload regression

j8
Ilya Daynatovich vor 8 Jahren
Ursprung
Commit
b409c8cc2f

+ 20
- 7
react/features/base/connection/actions.web.js Datei anzeigen

9
 import { SET_DOMAIN } from './actionTypes';
9
 import { SET_DOMAIN } from './actionTypes';
10
 
10
 
11
 import { appNavigate } from '../../app';
11
 import { appNavigate } from '../../app';
12
+import { setUnsupportedBrowser } from '../../unsupported-browser';
12
 
13
 
13
 declare var APP: Object;
14
 declare var APP: Object;
14
 
15
 
34
         // XXX For web based version we use conference initialization logic
35
         // XXX For web based version we use conference initialization logic
35
         // from the old app (at the moment of writing).
36
         // from the old app (at the moment of writing).
36
         return APP.conference.init({ roomName: room }).then(() => {
37
         return APP.conference.init({ roomName: room }).then(() => {
37
-            // If during the conference initialization was defined that browser
38
-            // doesn't support WebRTC then we should define which route
39
-            // to render.
40
-            if (APP.unsupportedBrowser) {
41
-                dispatch(appNavigate(room));
42
-            }
43
-
44
             if (APP.logCollector) {
38
             if (APP.logCollector) {
45
                 // Start the LogCollector's periodic "store logs" task
39
                 // Start the LogCollector's periodic "store logs" task
46
                 APP.logCollector.start();
40
                 APP.logCollector.start();
82
                 APP.UI.hideRingOverLay();
76
                 APP.UI.hideRingOverLay();
83
                 APP.API.notifyConferenceLeft(APP.conference.roomName);
77
                 APP.API.notifyConferenceLeft(APP.conference.roomName);
84
                 logger.error(err);
78
                 logger.error(err);
79
+
80
+                dispatch(setUnsupportedBrowser(err));
81
+
82
+                // If during the conference initialization was defined that
83
+                // browser doesn't support WebRTC then we should define
84
+                // which route to render.
85
+                dispatch(appNavigate(room));
86
+
87
+                // Force reinitialization of the conference if WebRTC is ready.
88
+                if (err.webRTCReadyPromise) {
89
+                    err.webRTCReadyPromise.then(() => {
90
+                        // Setting plugin required flag to false because
91
+                        // it's already been installed.
92
+                        dispatch(setUnsupportedBrowser({
93
+                            isPluginRequired: false
94
+                        }));
95
+                        dispatch(appNavigate(room));
96
+                    });
97
+                }
85
             });
98
             });
86
     };
99
     };
87
 }
100
 }

+ 11
- 6
react/features/base/util/interceptComponent.js Datei anzeigen

16
  * or not.
16
  * or not.
17
  *
17
  *
18
  * @private
18
  * @private
19
+ * @param {Object} state - Object containing current Redux state.
19
  * @returns {ReactElement|void}
20
  * @returns {ReactElement|void}
20
  * @type {Function[]}
21
  * @type {Function[]}
21
  */
22
  */
27
      * app even if the browser supports the app (e.g. Google Chrome with
28
      * app even if the browser supports the app (e.g. Google Chrome with
28
      * WebRTC support on Android).
29
      * WebRTC support on Android).
29
      *
30
      *
31
+     * @param {Object} state - Redux state of the app.
30
      * @returns {UnsupportedMobileBrowser|void} If the rule is satisfied then
32
      * @returns {UnsupportedMobileBrowser|void} If the rule is satisfied then
31
      * we should intercept existing component by UnsupportedMobileBrowser.
33
      * we should intercept existing component by UnsupportedMobileBrowser.
32
      */
34
      */
40
                     : NoMobileApp);
42
                     : NoMobileApp);
41
         }
43
         }
42
     },
44
     },
43
-    () => {
44
-        if (APP.unsupportedBrowser) {
45
-            const { isOldBrowser } = APP.unsupportedBrowser;
45
+    state => {
46
+        const {
47
+            isOldBrowser,
48
+            isPluginRequired
49
+        } = state['features/unsupported-browser'];
46
 
50
 
47
-            if (isOldBrowser) {
48
-                return UnsupportedDesktopBrowser;
49
-            }
51
+        if (isOldBrowser) {
52
+            return UnsupportedDesktopBrowser;
53
+        }
50
 
54
 
55
+        if (isPluginRequired) {
51
             return PluginRequiredBrowser;
56
             return PluginRequiredBrowser;
52
         }
57
         }
53
     }
58
     }

+ 11
- 0
react/features/unsupported-browser/actionTypes.js Datei anzeigen

16
  * }
16
  * }
17
  */
17
  */
18
 export const DISMISS_MOBILE_APP_PROMO = Symbol('DISMISS_MOBILE_APP_PROMO');
18
 export const DISMISS_MOBILE_APP_PROMO = Symbol('DISMISS_MOBILE_APP_PROMO');
19
+
20
+/**
21
+ * The type of Redux action which signals to change information about
22
+ * unsupported browser in Redux store.
23
+ *
24
+ * {
25
+ *      type: SET_UNSUPPORTED_BROWSER,
26
+ *      unsupportedBrowser: Object
27
+ * }
28
+ */
29
+export const SET_UNSUPPORTED_BROWSER = Symbol('SET_UNSUPPORTED_BROWSER');

+ 21
- 1
react/features/unsupported-browser/actions.js Datei anzeigen

1
-import { DISMISS_MOBILE_APP_PROMO } from './actionTypes';
1
+import {
2
+    DISMISS_MOBILE_APP_PROMO,
3
+    SET_UNSUPPORTED_BROWSER
4
+} from './actionTypes';
2
 
5
 
3
 /**
6
 /**
4
  * Returns a Redux action which signals that the UnsupportedMobileBrowser which
7
  * Returns a Redux action which signals that the UnsupportedMobileBrowser which
19
         type: DISMISS_MOBILE_APP_PROMO
22
         type: DISMISS_MOBILE_APP_PROMO
20
     };
23
     };
21
 }
24
 }
25
+
26
+/**
27
+ * Sets unsupported browser object.
28
+ *
29
+ * @param {Object} unsupportedBrowser - Object describing the unsupported
30
+ * browser.
31
+ * @returns {{
32
+ *      type: SET_UNSUPPORTED_BROWSER,
33
+ *      unsupportedBrowser: Object
34
+ *  }}
35
+ */
36
+export function setUnsupportedBrowser(unsupportedBrowser) {
37
+    return {
38
+        type: SET_UNSUPPORTED_BROWSER,
39
+        unsupportedBrowser
40
+    };
41
+}

+ 9
- 1
react/features/unsupported-browser/reducer.js Datei anzeigen

1
 import { ReducerRegistry } from '../base/redux';
1
 import { ReducerRegistry } from '../base/redux';
2
 
2
 
3
-import { DISMISS_MOBILE_APP_PROMO } from './actionTypes';
3
+import {
4
+    DISMISS_MOBILE_APP_PROMO,
5
+    SET_UNSUPPORTED_BROWSER
6
+} from './actionTypes';
4
 
7
 
5
 ReducerRegistry.register(
8
 ReducerRegistry.register(
6
         'features/unsupported-browser',
9
         'features/unsupported-browser',
21
                      */
24
                      */
22
                     mobileAppPromoDismissed: true
25
                     mobileAppPromoDismissed: true
23
                 };
26
                 };
27
+            case SET_UNSUPPORTED_BROWSER:
28
+                return {
29
+                    ...state,
30
+                    ...action.unsupportedBrowser
31
+                };
24
             }
32
             }
25
 
33
 
26
             return state;
34
             return state;

Laden…
Abbrechen
Speichern