diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-02-23 16:21:40 -0500 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-02-23 16:21:40 -0500 |
| commit | 3978bd82db12a4606ebb9a60c15352fb14ee0055 (patch) | |
| tree | 75ab957f75511c3cb096016ca73466fd33f27b19 /src/store/actions | |
| parent | 941594566dbb6547f8fca2c107aa86dd6cf609a0 (diff) | |
added sp image to store for profile preview, using React.memo to prevent UI updates
Diffstat (limited to 'src/store/actions')
| -rw-r--r-- | src/store/actions/user.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/store/actions/user.ts b/src/store/actions/user.ts index 3511dcf3..a9f9d945 100644 --- a/src/store/actions/user.ts +++ b/src/store/actions/user.ts @@ -13,6 +13,7 @@ import { setNewNotificationReceived, setNewVersionAvailable, setReplyPosted, + setSuggestedPeopleImage, setSuggestedPeopleLinked, socialEdited, userDetailsFetched, @@ -163,13 +164,16 @@ export const logout = (): ThunkAction< } }; -export const uploadedSuggestedPeoplePhoto = (): ThunkAction< - Promise<void>, - RootState, - unknown, - Action<string> -> => async (dispatch) => { +export const uploadedSuggestedPeoplePhoto = ( + imageUri: string, +): ThunkAction<Promise<void>, RootState, unknown, Action<string>> => async ( + dispatch, +) => { try { + await dispatch({ + type: setSuggestedPeopleImage.type, + payload: {suggestedPeopleImage: imageUri}, + }); dispatch({ type: setSuggestedPeopleLinked.type, payload: {suggested_people_linked: 1}, |
