@ -380,7 +380,7 @@ async function isMessageDuplicate({
if (!result) {
return false;
}
const filteredResult = result.filter(
const filteredResult = [result].filter(
(m: any) => m.attributes.body === message.body
);
const isSimilar = filteredResult.some((m: any) =>
@ -53,7 +53,7 @@ export class MessageController {
window.log.warn('Cleaning up getMessageController() oldest messages...');
const now = Date.now();
this.messageLookup.forEach(messageEntry => {
(this.messageLookup || []).forEach(messageEntry => {
const { message, timestamp } = messageEntry;
const conversation = message.getConversation();