mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Simplified time comparison in last-seen-at-updater
no issue - The code had un-needed complexity - Removing the extra complexity led to the same behavior, as validated by the unit tests
This commit is contained in:
parent
dafda42e0a
commit
36bb014fc0
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ class LastSeenAtUpdater {
|
|||
*/
|
||||
async updateLastSeenAt(memberId, memberLastSeenAt, timestamp) {
|
||||
const timezone = this._settingsCacheService.get('timezone');
|
||||
if (memberLastSeenAt === null || moment(moment.utc(timestamp).tz(timezone).startOf('day')).isAfter(moment.utc(memberLastSeenAt).tz(timezone).startOf('day'))) {
|
||||
if (memberLastSeenAt === null || moment(moment.utc(timestamp).tz(timezone).startOf('day')).isAfter(memberLastSeenAt)) {
|
||||
await this._memberModel.update({
|
||||
last_seen_at: moment.utc(timestamp).format('YYYY-MM-DD HH:mm:ss')
|
||||
}, {
|
||||
|
|
Loading…
Add table
Reference in a new issue