From 3b7bf256d83e1898642c2aab9072ffbeec8cc032 Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Mon, 14 Dec 2020 16:02:09 -0800 Subject: [TMA - 426] Fix recent search + Add refresh control (#138) * Got rid of small lint errors before start * Final push * Final * disable scroll first try / logic * small change * Try to make the cover photo consistent with different screen sizes * Final change * added RefreshControl * removed scale effect * Fix misorientation of cover * remove more scale stuff * fix userIDs for different views * Mend refresh control * white bg Co-authored-by: hsalhab --- src/utils/users.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/utils') diff --git a/src/utils/users.ts b/src/utils/users.ts index 30b9d77b..0ed490c7 100644 --- a/src/utils/users.ts +++ b/src/utils/users.ts @@ -1,3 +1,4 @@ +import {loadUserX} from './../store/actions/userX'; import {RootState} from './../store/rootReducer'; import AsyncStorage from '@react-native-community/async-storage'; import {AppDispatch} from './../store/configureStore'; @@ -53,6 +54,23 @@ export const userLogin = async (dispatch: AppDispatch, user: UserType) => { } }; +/** + * This tries to load data userX passed in + * @param dispatch This is the dispatch object from the redux store + * @param user The user + */ +export const fetchUserX = async ( + dispatch: AppDispatch, + user: UserType, + screenType: ScreenType, +) => { + try { + await Promise.all([dispatch(loadUserX(user, screenType))]); + } catch (error) { + console.log(error); + } +}; + /** * This function checks if the userX slice of our store contains the given user for the provided Screen */ -- cgit v1.2.3-70-g09d2