ソースを参照

feat(deeplinking): Pass state to openDesktopApp.

master
Hristo Terezov 6年前
コミット
651791b8df

+ 4
- 3
react/features/deep-linking/functions.js ファイルの表示

75
         return Promise.resolve();
75
         return Promise.resolve();
76
     }
76
     }
77
 
77
 
78
-    return _openDesktopApp().then(
78
+    return _openDesktopApp(state).then(
79
         // eslint-disable-next-line no-confusing-arrow
79
         // eslint-disable-next-line no-confusing-arrow
80
         result => result ? DeepLinkingDesktopPage : undefined);
80
         result => result ? DeepLinkingDesktopPage : undefined);
81
 }
81
 }
83
 /**
83
 /**
84
  * Opens the desktop app.
84
  * Opens the desktop app.
85
  *
85
  *
86
+ * @param {Object} state - Object containing current redux state.
86
  * @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
87
  * @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
87
  * with false otherwise.
88
  * with false otherwise.
88
  */
89
  */
89
-export function openDesktopApp() {
90
-    return _openDesktopApp();
90
+export function openDesktopApp(state) {
91
+    return _openDesktopApp(state);
91
 }
92
 }

+ 1
- 1
react/features/deep-linking/middleware.js ファイルの表示

15
 MiddlewareRegistry.register(store => next => action => {
15
 MiddlewareRegistry.register(store => next => action => {
16
     switch (action.type) {
16
     switch (action.type) {
17
     case OPEN_DESKTOP_APP:
17
     case OPEN_DESKTOP_APP:
18
-        openDesktopApp();
18
+        openDesktopApp(store.getState());
19
         break;
19
         break;
20
     }
20
     }
21
 
21
 

+ 4
- 1
react/features/deep-linking/openDesktopApp.js ファイルの表示

1
+// @flow
2
+
1
 /**
3
 /**
2
  * Opens the desktop app.
4
  * Opens the desktop app.
3
  *
5
  *
6
+ * @param {Object} state - Object containing current redux state.
4
  * @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
7
  * @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
5
  * with false otherwise.
8
  * with false otherwise.
6
  */
9
  */
7
-export function _openDesktopApp() {
10
+export function _openDesktopApp(state: Object) { // eslint-disable-line no-unused-vars
8
     return Promise.resolve(false);
11
     return Promise.resolve(false);
9
 }
12
 }

読み込み中…
キャンセル
保存