New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only change nick autocompletion when receiving a message #1495
Conversation
@@ -44,7 +44,7 @@ function appendMessage(container, chanId, chanType, msg) { | |||
|
|||
// Insert date marker if date changed compared to previous message | |||
if (prevMsgTime.toDateString() !== msgTime.toDateString()) { | |||
lastChild = $(templates.date_marker({msgDate: msg.time})); | |||
lastChild = $(templates.date_marker({time: msg.time})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this in previous PR.
time: msg.time, | ||
previews: [] | ||
}); | ||
const newCondensed = $(templates.msg_condensed({time: msg.time})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to build a complete message since it uses a separate template so we can just optimize it.
client/js/render.js
Outdated
@@ -77,12 +73,6 @@ function appendMessage(container, chanId, chanType, msg) { | |||
|
|||
function buildChatMessage(chanId, msg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChanId should be removed... which will create a fun diff. Feel free to leave it out of this PR for that reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's called in a single place, so it's easy.
And other minor optimizations and fixes
8fa373d
to
e2a122c
Compare
Loading more history would mess with autocompletion order (it would also sort for each message when loading the page, which is completely unnecessary).