diff --git a/server/chat-plugins/chatlog.ts b/server/chat-plugins/chatlog.ts index 4db71ea7b1..a9cd62ce20 100644 --- a/server/chat-plugins/chatlog.ts +++ b/server/chat-plugins/chatlog.ts @@ -911,7 +911,7 @@ export const pages: Chat.PageTable = { const parsedDate = new Date(date); const validDateStrings = ['all', 'alltime']; - const validNonDateTerm = search ? validDateStrings.includes(date) : date === 'today'; + const validNonDateTerm = date ? validDateStrings.includes(date) : date === 'today'; // this is apparently the best way to tell if a date is invalid if (isNaN(parsedDate.getTime()) && !validNonDateTerm) { throw new Chat.ErrorMessage(`Invalid date.`); @@ -928,6 +928,8 @@ export const pages: Chat.PageTable = { if (date === 'today') { this.setHTML(await LogViewer.day(roomid, LogReader.today(), opts)); if (isTime) this.send(`|scroll|div[data-server="${opts}"]`); + } else if (date === 'all' || date === 'alltime') { + return LogSearcher.runSearch(); } else if (date.split('-').length === 3) { this.setHTML(await LogViewer.day(roomid, parsedDate.toISOString().slice(0, 10), opts)); if (isTime) this.send(`|scroll|div[data-server="${opts}"]`);