allow choice of no identity (for testing)

This commit is contained in:
2023-07-04 13:15:52 -06:00
parent d98e95915b
commit e42b3ff11d
5 changed files with 66 additions and 30 deletions

View File

@@ -241,16 +241,27 @@ export default class HomeView extends Vue {
}
// agent.did is for legacy data, before March 2023
const giver =
const giverDid =
claim.agent?.identifier || claim.agent?.did || giveRecord.issuer;
const giverInfo = didInfo(giver, this.allAccounts, this.allContacts);
const giverInfo = didInfo(
giverDid,
this.activeDid,
this.allAccounts,
this.allContacts
);
const gaveAmount = claim.object?.amountOfThisGood
? this.displayAmount(claim.object.unitCode, claim.object.amountOfThisGood)
: claim.description || "something unknown";
// recipient.did is for legacy data, before March 2023
const gaveRecipientId = claim.recipient?.identifier || claim.recipient?.did;
const gaveRecipientInfo = gaveRecipientId
? " to " + didInfo(gaveRecipientId, this.allAccounts, this.allContacts)
? " to " +
didInfo(
gaveRecipientId,
this.activeDid,
this.allAccounts,
this.allContacts
)
: "";
return giverInfo + " gave " + gaveAmount + gaveRecipientInfo;
}
@@ -284,7 +295,7 @@ export default class HomeView extends Vue {
* @param hours may be 0
*/
recordGive(giverDid, description, hours) {
if (this.activeDid == null) {
if (!this.activeDid) {
this.alertTitle = "Error";
this.alertMessage =
"You must select an identity before you can record a give.";