From 5db2a2b38225a143e23ab635dbecadfb424a4546 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 9 Feb 2021 16:27:34 -0500 Subject: added onboarded flag to store --- src/store/actions/user.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/store/actions') diff --git a/src/store/actions/user.ts b/src/store/actions/user.ts index 990f9260..bfbe9c80 100644 --- a/src/store/actions/user.ts +++ b/src/store/actions/user.ts @@ -12,6 +12,7 @@ import { setIsOnboardedUser, setNewNotificationReceived, setNewVersionAvailable, + setOnboardedSuggestedPeople, setReplyPosted, socialEdited, userDetailsFetched, @@ -90,6 +91,24 @@ export const updateProfileCompletionStage = ( } }; +// TODO: this should be called after a successful upload of a first SP image +export const updateOnboardedSuggestedPeople = ( + onboarded: boolean, + callback: () => {}, +): ThunkAction, RootState, unknown, Action> => async ( + dispatch, +) => { + try { + dispatch({ + type: setOnboardedSuggestedPeople.type, + payload: {onboarded}, + }); + callback(); + } catch (error) { + console.log(error); + } +}; + export const updateIsOnboardedUser = ( isOnboardedUser: boolean, ): ThunkAction, RootState, unknown, Action> => async ( -- cgit v1.2.3-70-g09d2