From 4866416aae27794243bec0f427481c0affe6d401 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Thu, 20 Jul 2023 19:02:18 -0600 Subject: [PATCH] fix didInfo logic, and add to project lists --- src/libs/endorserServer.ts | 11 ++++++++--- src/views/DiscoverView.vue | 8 +++++--- src/views/ProjectViewView.vue | 12 ++++++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index 60455fb..b351ff9 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -82,10 +82,15 @@ export function isHiddenDid(did) { /** always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY **/ -export function didInfo(did, activeDid, allMyDids, contacts) { - const myId: string | undefined = R.find(R.identity, allMyDids); +export function didInfo( + did: string, + activeDid: string, + allMyDids: Array, + contacts: Array, +): string { + const myId: string | undefined = R.find(R.equals(did), allMyDids, did); if (myId) { - return "You" + (myId.did !== activeDid ? " (Alt ID)" : ""); + return "You" + (myId !== activeDid ? " (Alt ID)" : ""); } else { const contact: Contact | undefined = R.find((c) => c.did === did, contacts); if (contact) { diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index 260f13a..45c316d 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -93,7 +93,9 @@

{{ project.name }}

- {{ didInfo(project.issuer, activeDid, allMyDids, allContacts) }} + {{ + didInfo(project.issuerDid, activeDid, allMyDids, allContacts) + }}
@@ -206,8 +208,8 @@ export default class DiscoverView extends Vue { const plans: ProjectData[] = results.data; if (plans) { for (const plan of plans) { - const { name, description, handleId = plan.handleId, rowid } = plan; - this.projects.push({ name, description, handleId, rowid }); + const { name, description, handleId, rowid, issuerDid } = plan; + this.projects.push({ name, description, handleId, rowid, issuerDid }); } this.remoteCount = this.projects.length; } else { diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 7dc8c24..00f54d9 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -108,7 +108,11 @@ }}
- + {{ give.amount }}
@@ -131,7 +135,11 @@ }}
- + {{ give.amount }}