From 829994491cbd43cd788d4327de1d2659fab8c355 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Tue, 31 Oct 2023 19:58:37 -0600 Subject: [PATCH] improve messages for feed summaries --- src/libs/endorserServer.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index c20ed9f2..628d5bac 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -116,6 +116,8 @@ export function isHiddenDid(did: string) { /** always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY + + Similar logic is found in endorser-mobile. **/ export function didInfo( did: string, @@ -123,14 +125,14 @@ export function didInfo( allMyDids: string[], contacts: Contact[], ): string { + if (!did) return "Someone Anonymous"; + const myId = R.find(R.equals(did), allMyDids); if (myId) return `You${myId !== activeDid ? " (Alt ID)" : ""}`; const contact = R.find((c) => c.did === did, contacts); return contact - ? contact.name || "Someone Unnamed in Contacts" - : !did - ? "Unspecified Person" + ? contact.name || "Contact With No Name" : isHiddenDid(did) ? "Someone Not In Network" : "Someone Not In Contacts";