feat(deeplinking): Pass state to openDesktopApp.

This commit is contained in:
Hristo Terezov
2019-06-10 04:14:41 -07:00
parent 09cc738219
commit 651791b8df
3 changed files with 9 additions and 5 deletions
+4 -3
View File
@@ -75,7 +75,7 @@ export function getDeepLinkingPage(state) {
return Promise.resolve();
}
return _openDesktopApp().then(
return _openDesktopApp(state).then(
// eslint-disable-next-line no-confusing-arrow
result => result ? DeepLinkingDesktopPage : undefined);
}
@@ -83,9 +83,10 @@ export function getDeepLinkingPage(state) {
/**
* Opens the desktop app.
*
* @param {Object} state - Object containing current redux state.
* @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
* with false otherwise.
*/
export function openDesktopApp() {
return _openDesktopApp();
export function openDesktopApp(state) {
return _openDesktopApp(state);
}
+1 -1
View File
@@ -15,7 +15,7 @@ import { openDesktopApp } from './functions';
MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
case OPEN_DESKTOP_APP:
openDesktopApp();
openDesktopApp(store.getState());
break;
}
@@ -1,9 +1,12 @@
// @flow
/**
* Opens the desktop app.
*
* @param {Object} state - Object containing current redux state.
* @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
* with false otherwise.
*/
export function _openDesktopApp() {
export function _openDesktopApp(state: Object) { // eslint-disable-line no-unused-vars
return Promise.resolve(false);
}