We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 567da16 commit 1406d71Copy full SHA for 1406d71
1 file changed
chat-app/frontEnd/script.js
@@ -67,7 +67,8 @@ async function renderMessages() {
67
}
68
69
if (messages.length > 0) {
70
- lastTimestamp = Math.max(lastTimestamp, ...messages.map((m) => m.timestamp));
+ const lastMessage = messages[messages.length - 1];
71
+ lastTimestamp = Math.max(lastTimestamp, lastMessage.timestamp);
72
73
74
messages.sort((a, b) => a.timestamp - b.timestamp);
0 commit comments