Skip to content

Commit

Permalink
1280 - Fix bug where the Dashboard was checking in the wrong place to…
Browse files Browse the repository at this point in the history
… determine if the user is recently created
  • Loading branch information
nicksayre committed Nov 27, 2024
1 parent 5f6f046 commit fc44fff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const simpleUser = {
],
account: {
accountUuid: '7d9e2bfb-13ae-45c8-8764-ea3c87cd8af3',
createdAt: '2023-10-05T12:00:00+00:00',
},
profile: {
initialSignIn: '2023-10-05T12:00:00+00:00',
email: '[email protected]',
firstName: 'MITCHELL',
middleName: 'G',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const LOA1Content = ({
TOGGLE_NAMES.veteranOnboardingShowWelcomeMessageToNewUsers,
);

const userCreationTime = new Date(user.profile.createdAt);
const userCreationTime = new Date(user.profile.initialSignIn);
const oneDayLater = new Date(
userCreationTime.getTime() + 24 * 60 * 60 * 1000,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('<Dashboard />', () => {
};

// User created 8 hours ago is recent
initialState.user.profile.createdAt = new Date(
initialState.user.profile.initialSignIn = new Date(
new Date().getTime() - 8 * 60 * 60 * 1000,
);

Expand All @@ -107,7 +107,7 @@ describe('<Dashboard />', () => {
};

// User created 36 hours ago is not recent
initialState.user.profile.createdAt = new Date(
initialState.user.profile.initialSignIn = new Date(
new Date().getTime() - 36 * 60 * 60 * 1000,
);

Expand Down
5 changes: 3 additions & 2 deletions src/platform/user/profile/utilities/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ export function mapRawUserDataToState(json) {
const {
data: {
attributes: {
account: { accountUuid, createdAt } = {},
account: { accountUuid } = {},
inProgressForms: savedForms,
prefillsAvailable,
profile: {
initialSignIn,
signIn,
birthDate: dob,
email,
Expand Down Expand Up @@ -61,7 +62,7 @@ export function mapRawUserDataToState(json) {
const userState = {
accountType: loa.current,
accountUuid,
createdAt,
initialSignIn,
dob,
email,
gender,
Expand Down

0 comments on commit fc44fff

Please sign in to comment.