webmail: don't who an age of "-<1min", drop the -

if a browser is ahead just a few seconds, we would show "-<1min", not great.
just show "<1min" in that case. we'll still show negative age if drift is more
than 1 minute, which seems like a good hint to get time fixed on either client
or server.
This commit is contained in:
Mechiel Lukkien 2024-01-23 17:01:34 +01:00
parent ed8938c113
commit 9cf8ee2162
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View file

@ -2648,6 +2648,8 @@ const newMsgitemView = (mi, msglistView, otherMailbox, listMailboxes, receivedTi
if (t < 60) {
s = '<1min';
nextSecs = 60 - t;
// Prevent showing '-<1min' when browser and server have relatively small time drift of max 1 minute.
negative = '';
}
dom._kids(r, negative + s);
// note: Cannot have delays longer than 24.8 days due to storage as 32 bit in

View file

@ -1939,6 +1939,8 @@ const newMsgitemView = (mi: api.MessageItem, msglistView: MsglistView, otherMail
if (t < 60) {
s = '<1min'
nextSecs = 60-t
// Prevent showing '-<1min' when browser and server have relatively small time drift of max 1 minute.
negative = ''
}
dom._kids(r, negative+s)