From 7d7463d9853c0edaeec90fca09c2de649e097f09 Mon Sep 17 00:00:00 2001 From: remip <rpapin@grandlyon.com> Date: Mon, 5 Oct 2020 11:37:32 +0200 Subject: [PATCH] Change haveSeenWelcomeModal to isFirstConnection --- src/atoms/userProfile.state.ts | 2 +- src/components/Content/Content.tsx | 4 ++-- src/db/userProfileData.json | 2 +- src/models/userProfile.model.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/atoms/userProfile.state.ts b/src/atoms/userProfile.state.ts index 848cb6127..2b5287af8 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 c04890a8e..0716a3d38 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 6c7cc8692..5ae34a985 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 be4994ed1..1b2a1df61 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 -- GitLab