clean up typingUsers fetch()
This commit is contained in:
parent
121752cc6c
commit
10946d16bd
@ -217,6 +217,7 @@ class MessageForm extends PureComponent {
|
||||
}
|
||||
|
||||
const handleUserTyping = () => {
|
||||
if (error) return;
|
||||
startUserTyping(chatId);
|
||||
};
|
||||
|
||||
|
@ -19,18 +19,26 @@ class ChatContainer extends PureComponent {
|
||||
}
|
||||
|
||||
export default withTracker(() => {
|
||||
const idChatOpen = Session.get('idChatOpen');
|
||||
|
||||
const cleanScrollAndSendMessage = (message) => {
|
||||
ChatService.updateScrollPosition(null);
|
||||
return ChatService.sendGroupMessage(message);
|
||||
};
|
||||
|
||||
const typingUsers = UsersTyping.find({
|
||||
meetingId: Auth.meetingID,
|
||||
$or: [
|
||||
{ isTypingTo: PUBLIC_CHAT_KEY },
|
||||
{ isTypingTo: Auth.userID },
|
||||
],
|
||||
}).fetch();
|
||||
let typingUsers = null;
|
||||
if (idChatOpen === 'public') {
|
||||
typingUsers = UsersTyping.find({
|
||||
meetingId: Auth.meetingID,
|
||||
isTypingTo: PUBLIC_CHAT_KEY,
|
||||
}).fetch();
|
||||
} else {
|
||||
typingUsers = UsersTyping.find({
|
||||
meetingId: Auth.meetingID,
|
||||
isTypingTo: Auth.userID,
|
||||
userId: idChatOpen,
|
||||
}).fetch();
|
||||
}
|
||||
|
||||
const currentUser = Users.findOne({
|
||||
meetingId: Auth.meetingID,
|
||||
@ -50,7 +58,7 @@ export default withTracker(() => {
|
||||
stopUserTyping,
|
||||
currentUserId: currentUser ? currentUser.userId : null,
|
||||
typingUsers,
|
||||
currentChatPartner: Session.get('idChatOpen'),
|
||||
currentChatPartner: idChatOpen,
|
||||
UnsentMessagesCollection: ChatService.UnsentMessagesCollection,
|
||||
minMessageLength: CHAT_CONFIG.min_message_length,
|
||||
maxMessageLength: CHAT_CONFIG.max_message_length,
|
||||
|
Loading…
Reference in New Issue
Block a user