Skip to content

Commit 8c09279

Browse files
committed
directly compare the date string and add comment
1 parent 74f6e11 commit 8c09279

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/libs/UserUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ function getLoginKey(login: NewLogin) {
5050
}
5151

5252
function getLastLogin(login: NewLogin) {
53-
return new Date(login.lastLogin) > new Date(login.created) ? login.lastLogin : login.created;
53+
// If we have not reauthenticated, then lastLogin will still be the default 2008-01-01 value. So the created time stamp will be more accurate in that case.
54+
return login.lastLogin > login.created ? login.lastLogin : login.created;
5455
}
5556

5657
const DEVICE_PARTNER_IDS = new Set<number>([CONST.PARTNER_ID.IPHONE, CONST.PARTNER_ID.ANDROID, CONST.PARTNER_ID.NEWDOT]);

0 commit comments

Comments
 (0)