diff --git a/client/webapp/message-ram-cache.ts b/client/webapp/message-ram-cache.ts index cca7d62..d028f0a 100644 --- a/client/webapp/message-ram-cache.ts +++ b/client/webapp/message-ram-cache.ts @@ -89,6 +89,10 @@ export default class MessageRAMCache { value.lastUsed = new Date(); let allRecentMessages = Array.from(value.messages.values()).sort((a, b) => a.sent.getTime() - b.sent.getTime()); let start = Math.min(allRecentMessages.length - number, 0); - return allRecentMessages.slice(start, 0); + let result = allRecentMessages.slice(start); + if (result.length === 0) { + return null; + } + return result; } } \ No newline at end of file