mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix duplicate message
This commit is contained in:
@@ -307,6 +307,23 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.date = {}
|
||||
const allMessage = [];
|
||||
|
||||
// let ids = {}
|
||||
// messages = messages.filter((message: any) => {
|
||||
// if (message.$createAt) {
|
||||
// if (!ids[message.$createAt]) {
|
||||
// ids[message.$createAt] = true;
|
||||
// return true; // Keep this message
|
||||
// } else {
|
||||
// console.log('delete');
|
||||
// return false; // Remove this message
|
||||
// }
|
||||
// }
|
||||
// return true; // Keep messages without an id
|
||||
// });
|
||||
|
||||
|
||||
messages = messages.sort((a: any, b: any) => a.$createAt - b.$createAt)
|
||||
|
||||
for(const message of messages) {
|
||||
const date = whatsappDate(message.sentAt, false)
|
||||
if(!this.date[date]) {
|
||||
|
||||
Reference in New Issue
Block a user