From b7b277634020edc4d44ffb887b958dd94c26e665 Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Wed, 13 Nov 2019 16:18:09 +1100 Subject: [PATCH] Address review --- js/views/conversation_view.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index b9fbcd2fb..6a798cf78 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -346,13 +346,18 @@ ); const allMembers = await Promise.all( - allPubKeys.map(async pubKey => ({ - id: pubKey, - authorPhoneNumber: pubKey, - authorProfileName: await ConversationController.get( - pubKey - ).getProfileName(), - })) + allPubKeys.map(async pubKey => { + const conv = ConversationController.get(pubKey); + let profileName = 'Anonymous'; + if (conv) { + profileName = await conv.getProfileName(); + } + return { + id: pubKey, + authorPhoneNumber: pubKey, + authorProfileName: profileName, + }; + }) ); window.lokiPublicChatAPI.setListOfMembers(allMembers); };