diff --git a/src/pages/chats/chats.ts b/src/pages/chats/chats.ts index b495cc682..06ec99741 100644 --- a/src/pages/chats/chats.ts +++ b/src/pages/chats/chats.ts @@ -31,13 +31,7 @@ export class ChatsPage implements OnInit { } removeChat(chat: Chat): void { - this.chats = this.chats.map((chatsArray: Chat[]) => { - const chatIndex = chatsArray.indexOf(chat); - if (chatIndex !== -1) { - chatsArray.splice(chatIndex, 1); - } - - return chatsArray; + Chats.remove({_id: chat._id}).subscribe(() => { }); } }