diff --git a/playwright.config-local.ts b/playwright.config-local.ts index 02f0ae3..eb95e44 100644 --- a/playwright.config-local.ts +++ b/playwright.config-local.ts @@ -74,7 +74,7 @@ export default defineConfig({ /* Configure global timeout; default is 30000 milliseconds */ // the image upload will often not succeed at 5 seconds - //timeout: 10000, + timeout: 15000, /* Run your local dev server before starting the tests */ /** diff --git a/src/libs/util.ts b/src/libs/util.ts index a40f4c4..9830ee7 100644 --- a/src/libs/util.ts +++ b/src/libs/util.ts @@ -1,11 +1,14 @@ // many of these are also found in endorser-mobile utility.ts import axios, { AxiosResponse } from "axios"; +import { Buffer } from "buffer"; +import * as R from "ramda"; import { useClipboard } from "@vueuse/core"; import { DEFAULT_PUSH_SERVER } from "@/constants/app"; import { accountsDB, db } from "@/db/index"; import { Account } from "@/db/tables/accounts"; +import { Contact } from "@/db/tables/contacts"; import { DEFAULT_PASSKEY_EXPIRATION_MINUTES, MASTER_SETTINGS_KEY, @@ -18,11 +21,9 @@ import { OfferVerifiableCredential, } from "@/libs/endorserServer"; import * as serverUtil from "@/libs/endorserServer"; -import { registerCredential } from "@/libs/crypto/vc/passkeyDidPeer"; - -import { Buffer } from "buffer"; import { KeyMeta } from "@/libs/crypto/vc"; import { createPeerDid } from "@/libs/crypto/vc/didPeer"; +import { registerCredential } from "@/libs/crypto/vc/passkeyDidPeer"; export const PRIVACY_MESSAGE = "The data you send will be visible to the world -- except: your IDs and the IDs of anyone you tag will stay private, only visible to them and others you explicitly allow."; @@ -91,6 +92,28 @@ export const isGiveAction = ( return veriClaim.claimType === "GiveAction"; }; +export const nameForDid = ( + activeDid: string, + contacts: Array, + did: string, +): string => { + if (did === activeDid) { + return "you"; + } + const contact = R.find((con) => con.did == did, contacts); + return nameForContact(contact); +}; + +export const nameForContact = ( + contact?: Contact, + capitalize?: boolean, +): string => { + return ( + (contact?.name as string) || + (capitalize ? "This" : "this") + " unnamed user" + ); +}; + export const doCopyTwoSecRedo = (text: string, fn: () => void) => { fn(); useClipboard() diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 6d282d9..b2714e5 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -37,7 +37,7 @@ class="px-4 rounded-r bg-slate-200 border border-l-0 border-slate-400" @click="onClickNewContact()" > - + @@ -82,10 +82,10 @@