forked from jsnbuchanan/crowd-funder-for-time-pwa
allow choice of no identity (for testing)
This commit is contained in:
@@ -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.";
|
||||
|
||||
Reference in New Issue
Block a user