diff --git a/src/atoms/userProfile.state.ts b/src/atoms/userProfile.state.ts index 848cb6127f05a896ca994b08c5003016f8614c70..2b5287af853782a4354ff6de2e1dc4fdff10ba20 100644 --- a/src/atoms/userProfile.state.ts +++ b/src/atoms/userProfile.state.ts @@ -8,7 +8,7 @@ export const userProfileState = atom<UserProfile>({ level: 0, challengeTypeHash: '', ecogestureHash: '', - haveSeenWelcomeModal: false, + isFirstConnection: true, haveSeenOldFluidModal: false, notificationEcogesture: [], report: false, diff --git a/src/components/Content/Content.tsx b/src/components/Content/Content.tsx index c04890a8e944ea98bbd6d53e0913e484497a8c0e..0716a3d38605dc60e930b7dd20d3bc1ff4842690 100644 --- a/src/components/Content/Content.tsx +++ b/src/components/Content/Content.tsx @@ -65,7 +65,7 @@ const Content: React.FC<ContentProps> = ({ mailService.SendMail(client, mailData) const userProfileService = new UserProfileService(client) await userProfileService - .updateUserProfile({ haveSeenWelcomeModal: true }) + .updateUserProfile({ isFirstConnection: false }) .then(updatedUserProfile => { updatedUserProfile && setUserProfile(updatedUserProfile) }) @@ -104,7 +104,7 @@ const Content: React.FC<ContentProps> = ({ return ( <> <WelcomeModal - open={!userProfile.haveSeenWelcomeModal} + open={userProfile.isFirstConnection} handleCloseClick={setWelcomeModalViewed} /> <FeedbackModal diff --git a/src/db/userProfileData.json b/src/db/userProfileData.json index 6c7cc86923bf222058321f83c0c8e46d979dfc85..5ae34a9853ffee3bf24ead8efe191b4183203eb2 100644 --- a/src/db/userProfileData.json +++ b/src/db/userProfileData.json @@ -3,7 +3,7 @@ "level": 1, "challengeTypeHash": "", "ecogestureHash": "", - "haveSeenWelcomeModal": false, + "isFirstConnection": true, "haveSeenOldFluidModal": false, "notificationEcogesture": ["0085", "0092"], "report": false diff --git a/src/models/userProfile.model.ts b/src/models/userProfile.model.ts index be4994ed1f2b04d2f426ec7f56e6807ca48b5cb0..1b2a1df61fe08d0a2b9f354b30fe579abe5a0636 100644 --- a/src/models/userProfile.model.ts +++ b/src/models/userProfile.model.ts @@ -5,7 +5,7 @@ export interface UserProfile { level: number challengeTypeHash: string ecogestureHash: string - haveSeenWelcomeModal: boolean + isFirstConnection: boolean haveSeenOldFluidModal: DateTime | false notificationEcogesture: string[] report: boolean