improve messages for feed summaries

This commit is contained in:
2023-10-31 19:58:37 -06:00
parent ce06e8f0fa
commit 829994491c

View File

@@ -116,6 +116,8 @@ export function isHiddenDid(did: string) {
/** /**
always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY
Similar logic is found in endorser-mobile.
**/ **/
export function didInfo( export function didInfo(
did: string, did: string,
@@ -123,14 +125,14 @@ export function didInfo(
allMyDids: string[], allMyDids: string[],
contacts: Contact[], contacts: Contact[],
): string { ): string {
if (!did) return "Someone Anonymous";
const myId = R.find(R.equals(did), allMyDids); const myId = R.find(R.equals(did), allMyDids);
if (myId) return `You${myId !== activeDid ? " (Alt ID)" : ""}`; if (myId) return `You${myId !== activeDid ? " (Alt ID)" : ""}`;
const contact = R.find((c) => c.did === did, contacts); const contact = R.find((c) => c.did === did, contacts);
return contact return contact
? contact.name || "Someone Unnamed in Contacts" ? contact.name || "Contact With No Name"
: !did
? "Unspecified Person"
: isHiddenDid(did) : isHiddenDid(did)
? "Someone Not In Network" ? "Someone Not In Network"
: "Someone Not In Contacts"; : "Someone Not In Contacts";