Ver código fonte

feat(deeplinking): Pass state to openDesktopApp.

j8
Hristo Terezov 6 anos atrás
pai
commit
651791b8df

+ 4
- 3
react/features/deep-linking/functions.js Ver arquivo

@@ -75,7 +75,7 @@ export function getDeepLinkingPage(state) {
75 75
         return Promise.resolve();
76 76
     }
77 77
 
78
-    return _openDesktopApp().then(
78
+    return _openDesktopApp(state).then(
79 79
         // eslint-disable-next-line no-confusing-arrow
80 80
         result => result ? DeepLinkingDesktopPage : undefined);
81 81
 }
@@ -83,9 +83,10 @@ export function getDeepLinkingPage(state) {
83 83
 /**
84 84
  * Opens the desktop app.
85 85
  *
86
+ * @param {Object} state - Object containing current redux state.
86 87
  * @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
87 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 Ver arquivo

@@ -15,7 +15,7 @@ import { openDesktopApp } from './functions';
15 15
 MiddlewareRegistry.register(store => next => action => {
16 16
     switch (action.type) {
17 17
     case OPEN_DESKTOP_APP:
18
-        openDesktopApp();
18
+        openDesktopApp(store.getState());
19 19
         break;
20 20
     }
21 21
 

+ 4
- 1
react/features/deep-linking/openDesktopApp.js Ver arquivo

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

Carregando…
Cancelar
Salvar