chat: Move chatHead client var to clientVars hook

This commit is contained in:
Richard Hansen 2022-04-08 00:00:38 -04:00
parent 8d5fdd7dc9
commit 2e684476cb
5 changed files with 14 additions and 4 deletions

View file

@ -23,6 +23,8 @@ const sendChatMessageToPadClients = async (message, padId) => {
await promise;
};
exports.clientVars = (hookName, {pad: {chatHead}}) => ({chatHead});
exports.eejsBlock_mySettings = (hookName, context) => {
context.content += `
<p class="hide-for-mobile">

View file

@ -903,9 +903,6 @@ const handleClientReady = async (socket, message) => {
padShortcutEnabled: settings.padShortcutEnabled,
initialTitle: `Pad: ${sessionInfo.auth.padID}`,
opts: {},
// tell the client the number of the latest chat-message, which will be
// used to request the latest 100 chat-messages later (GET_CHAT_MESSAGES)
chatHead: pad.chatHead,
numConnectedUsers: roomSockets.length,
readOnlyId: sessionInfo.readOnlyPadId,
readonly: sessionInfo.readonly,