Skip to content
Snippets Groups Projects
Commit 3b2e5369 authored by bobakoftadeh's avatar bobakoftadeh
Browse files

Fix clear chat bug

parent 5776e9b4
No related branches found
No related tags found
No related merge requests found
......@@ -9,21 +9,19 @@ export default function clearGroupChatMsg(meetingId, chatId) {
const CHAT_CLEAR_MESSAGE = CHAT_CONFIG.system_messages_keys.chat_clear;
if (chatId) {
GroupChatMsg.remove({ meetingId, chatId }, () => {
Logger.info(`Cleared GroupChatMsg (${meetingId}, ${chatId})`);
const clearMsg = {
color: '0',
timestamp: Date.now(),
correlationId: `${PUBLIC_CHAT_SYSTEM_ID}-${Date.now()}`,
sender: {
id: PUBLIC_CHAT_SYSTEM_ID,
name: '',
},
message: CHAT_CLEAR_MESSAGE,
};
return addGroupChatMsg(meetingId, PUBLIC_GROUP_CHAT_ID, clearMsg);
});
GroupChatMsg.remove({ meetingId, chatId });
Logger.info(`Cleared GroupChatMsg (${meetingId}, ${chatId})`);
const clearMsg = {
color: '0',
timestamp: Date.now(),
correlationId: `${PUBLIC_CHAT_SYSTEM_ID}-${Date.now()}`,
sender: {
id: PUBLIC_CHAT_SYSTEM_ID,
name: '',
},
message: CHAT_CLEAR_MESSAGE,
};
return addGroupChatMsg(meetingId, PUBLIC_GROUP_CHAT_ID, clearMsg);
}
if (meetingId) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment