Browse Source

fix didInfo logic, and add to project lists

ui-fix
Trent Larson 1 year ago
parent
commit
4866416aae
  1. 11
      src/libs/endorserServer.ts
  2. 8
      src/views/DiscoverView.vue
  3. 12
      src/views/ProjectViewView.vue

11
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<string>,
contacts: Array<Contact>,
): 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) {

8
src/views/DiscoverView.vue

@ -93,7 +93,9 @@
<h2 class="text-base font-semibold">{{ project.name }}</h2>
<div class="text-sm">
<fa icon="user" class="fa-fw text-slate-400"></fa>
{{ didInfo(project.issuer, activeDid, allMyDids, allContacts) }}
{{
didInfo(project.issuerDid, activeDid, allMyDids, allContacts)
}}
</div>
</div>
</a>
@ -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 {

12
src/views/ProjectViewView.vue

@ -108,7 +108,11 @@
}}</span>
</div>
<div class="flex gap-2" v-if="give.amount">
<fa icon="clock" v-if="give.unit === 'HUR'" class="fa-fw text-slate-400"></fa>
<fa
icon="clock"
v-if="give.unit === 'HUR'"
class="fa-fw text-slate-400"
></fa>
<fa icon="coins" v-else class="fa-fw text-slate-400"></fa>
<span>{{ give.amount }}</span>
</div>
@ -131,7 +135,11 @@
}}</span>
</div>
<div class="flex gap-2" v-if="give.amount">
<fa icon="clock" v-if="give.unit === 'HUR'" class="fa-fw text-slate-400"></fa>
<fa
icon="clock"
v-if="give.unit === 'HUR'"
class="fa-fw text-slate-400"
></fa>
<fa icon="coins" v-else class="fa-fw text-slate-400"></fa>
<span>{{ give.amount }}</span>
</div>

Loading…
Cancel
Save