forked from trent_larson/crowd-funder-for-time-pwa
allow choice of no identity (for testing)
This commit is contained in:
@@ -3,6 +3,7 @@ import { IIdentifier } from "@veramo/core";
|
||||
import { accessToken, SimpleSigner } from "@/libs/crypto";
|
||||
import * as didJwt from "did-jwt";
|
||||
import { Axios, AxiosResponse } from "axios";
|
||||
import { Contact } from "@/db/tables/contacts";
|
||||
|
||||
export const SCHEMA_ORG_CONTEXT = "https://schema.org";
|
||||
export const SERVICE_ID = "endorser.ch";
|
||||
@@ -81,12 +82,15 @@ export function isHiddenDid(did) {
|
||||
/**
|
||||
always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY
|
||||
**/
|
||||
export function didInfo(did, identifiers, contacts) {
|
||||
const myId = R.find((i) => i.did === did, identifiers);
|
||||
export function didInfo(did, activeDid, identifiers, contacts) {
|
||||
const myId: IIdentifier | undefined = R.find(
|
||||
(i) => i.did === did,
|
||||
identifiers
|
||||
);
|
||||
if (myId) {
|
||||
return "You";
|
||||
return "You" + (myId.did !== activeDid ? " (Alt ID)" : "");
|
||||
} else {
|
||||
const contact = R.find((c) => c.did === did, contacts);
|
||||
const contact: Contact | undefined = R.find((c) => c.did === did, contacts);
|
||||
if (contact) {
|
||||
return contact.name || "Someone Unnamed in Contacts";
|
||||
} else if (!did) {
|
||||
|
||||
Reference in New Issue
Block a user