Skip to content

Commit

Permalink
fix: 🐛 show all open chats
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed Jun 11, 2020
1 parent 7d5133a commit 79fde11
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/utils/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ export const getSenders = (bySender: {}): MessagesType[] => {
for (const key in bySender) {
if (Object.prototype.hasOwnProperty.call(bySender, key)) {
const messages = bySender[key];
const sorted = sortBy(messages, 'date').reverse();
const element: MessageType[] = sorted.filter(p => p.verified || p.isSent);
const sorted: MessageType[] = sortBy(messages, 'date').reverse();

if (element.length > 0) {
const chat = element[0];
if (sorted.length > 0) {
const chat = sorted[0];
const { sender } = chat;

if (sender) {
Expand Down

0 comments on commit 79fde11

Please sign in to comment.