diff options
Diffstat (limited to 'src/store/actions')
| -rw-r--r-- | src/store/actions/userX.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/store/actions/userX.ts b/src/store/actions/userX.ts index 6772837b..39d3f918 100644 --- a/src/store/actions/userX.ts +++ b/src/store/actions/userX.ts @@ -131,6 +131,7 @@ export const resetScreenType = ( export const updateUserXProfileAllScreens = ( userId: string, + state: RootState, ): ThunkAction<Promise<void>, RootState, unknown, Action<string>> => async ( dispatch, ) => { @@ -142,13 +143,15 @@ export const updateUserXProfileAllScreens = ( ]; const token = await getTokenOrLogout(dispatch); screens.forEach((screenType) => { - loadProfileInfo(token, userId).then((data) => { - console.log('DATA FETCHED: ', data); - dispatch({ - type: userXProfileFetched.type, - payload: {screenType, userId, data}, + if (userXInStore(state, screenType, userId)) { + loadProfileInfo(token, userId).then((data) => { + console.log('DATA FETCHED: ', data); + dispatch({ + type: userXProfileFetched.type, + payload: {screenType, userId, data}, + }); }); - }); + } }); } catch (error) { console.log(error); |
