feat(deeplinking): Pass state to openDesktopApp.

This commit is contained in:
Hristo Terezov 2019-06-07 14:06:52 +01:00
parent 09cc738219
commit 651791b8df
3 changed files with 9 additions and 5 deletions

View File

@ -75,7 +75,7 @@ export function getDeepLinkingPage(state) {
return Promise.resolve(); return Promise.resolve();
} }
return _openDesktopApp().then( return _openDesktopApp(state).then(
// eslint-disable-next-line no-confusing-arrow // eslint-disable-next-line no-confusing-arrow
result => result ? DeepLinkingDesktopPage : undefined); result => result ? DeepLinkingDesktopPage : undefined);
} }
@ -83,9 +83,10 @@ export function getDeepLinkingPage(state) {
/** /**
* Opens the desktop app. * 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 * @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
* with false otherwise. * with false otherwise.
*/ */
export function openDesktopApp() { export function openDesktopApp(state) {
return _openDesktopApp(); return _openDesktopApp(state);
} }

View File

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

View File

@ -1,9 +1,12 @@
// @flow
/** /**
* Opens the desktop app. * 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 * @returns {Promise<boolean>} - Resolves with true if the attempt to open the desktop app was successful and resolves
* with false otherwise. * with false otherwise.
*/ */
export function _openDesktopApp() { export function _openDesktopApp(state: Object) { // eslint-disable-line no-unused-vars
return Promise.resolve(false); return Promise.resolve(false);
} }