diff --git a/src/libs/util.ts b/src/libs/util.ts index 286d2a6b6..91e1c3be3 100644 --- a/src/libs/util.ts +++ b/src/libs/util.ts @@ -102,11 +102,13 @@ export const doCopyTwoSecRedo = (text: string, fn: () => void) => { * @param veriClaim is expected to have fields: claim, claimType, and issuer */ export const isGiveRecordTheUserCanConfirm = ( + isRegistered: boolean, veriClaim: GenericCredWrapper, activeDid: string, confirmerIdList: string[] = [], ) => { return ( + isRegistered && isGiveAction(veriClaim) && !confirmerIdList.includes(activeDid) && veriClaim.issuer !== activeDid && diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index 8ecf93fa5..7972dce1b 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -136,6 +136,7 @@ class="col-span-1 bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md" v-if=" libsUtil.isGiveRecordTheUserCanConfirm( + isRegistered, veriClaim, activeDid, confirmerIdList, @@ -472,6 +473,7 @@ export default class ClaimView extends Vue { fullClaimDump = ""; fullClaimMessage = ""; isEditedGlobalId = false; + isRegistered = false; numConfsNotVisible = 0; // number of hidden DIDs in the confirmerIdList, minus the issuer if they aren't visible showDidCopy = false; showIdCopy = false; @@ -496,6 +498,7 @@ export default class ClaimView extends Vue { this.fullClaimDump = ""; this.fullClaimMessage = ""; this.isEditedGlobalId = false; + this.isRegistered = false; this.numConfsNotVisible = 0; this.veriClaim = serverUtil.BLANK_GENERIC_SERVER_RECORD; this.veriClaimDump = ""; @@ -507,6 +510,7 @@ export default class ClaimView extends Vue { this.activeDid = settings?.activeDid || ""; this.apiServer = settings?.apiServer || ""; this.allContacts = await db.contacts.toArray(); + this.isRegistered = settings?.isRegistered || false; await accountsDB.open(); const accounts = accountsDB.accounts; diff --git a/src/views/ConfirmGiftView.vue b/src/views/ConfirmGiftView.vue index 938a7481e..87729dc8a 100644 --- a/src/views/ConfirmGiftView.vue +++ b/src/views/ConfirmGiftView.vue @@ -15,6 +15,7 @@ @@ -431,6 +434,7 @@ export default class ClaimView extends Vue { giverName = ""; issuerName = ""; isLoading = false; + isRegistered = false; numConfsNotVisible = 0; // number of hidden DIDs in the confirmerIdList, minus the issuer if they aren't visible recipientName = ""; showDetails = false; @@ -450,6 +454,7 @@ export default class ClaimView extends Vue { this.confsVisibleErrorMessage = ""; this.confsVisibleToIdList = []; this.giveDetails = null; + this.isRegistered = false; this.numConfsNotVisible = 0; this.urlForNewGive = ""; this.veriClaim = serverUtil.BLANK_GENERIC_SERVER_RECORD; @@ -463,6 +468,7 @@ export default class ClaimView extends Vue { this.activeDid = settings?.activeDid || ""; this.apiServer = settings?.apiServer || ""; this.allContacts = await db.contacts.toArray(); + this.isRegistered = settings?.isRegistered || false; await accountsDB.open(); const accounts = accountsDB.accounts; @@ -782,7 +788,17 @@ export default class ClaimView extends Vue { } notifyWhyCannotConfirm() { - if (!isGiveAction(this.veriClaim)) { + if (!this.isRegistered) { + this.$notify( + { + group: "alert", + type: "info", + title: "Not Registered", + text: "Someone needs to register you before you can contribute.", + }, + 3000, + ); + } else if (!isGiveAction(this.veriClaim)) { this.$notify( { group: "alert", diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index b30db8f77..49c06f470 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -159,7 +159,7 @@ -
+