Browse Source

fix so that contact recipient is also recorded

pull/50/head
Trent Larson 1 year ago
parent
commit
0444b5be32
  1. 2
      project.task.yaml
  2. 35
      src/views/ContactsView.vue

2
project.task.yaml

@ -1,5 +1,6 @@
tasks: tasks:
- .2 bug - on contacts view, click on "to" & "from" and nothing happens
- 01 add a location for a project via map pin - 01 add a location for a project via map pin
- 04 search by a bounding box for local projects (see API by clicking on "Nearby") - 04 search by a bounding box for local projects (see API by clicking on "Nearby")
- 01 Replace Gifted/Give in ContactsView with GiftedDialog assignee:jose - 01 Replace Gifted/Give in ContactsView with GiftedDialog assignee:jose
@ -32,6 +33,7 @@ tasks:
- .2 on ProjectViewView, show different messages for "to" and "from" sections if none exist - .2 on ProjectViewView, show different messages for "to" and "from" sections if none exist
- .2 fix static icon to the right on project page (Matthew - I've made "Rotary" into issuer?) - .2 fix static icon to the right on project page (Matthew - I've made "Rotary" into issuer?)
- .2 fix rate limit verbiage (with the new one-per-day allowance) assignee:trent - .2 fix rate limit verbiage (with the new one-per-day allowance) assignee:trent
- .2 move 'switch identity' to the advanced section
- Discuss whether the remaining tasks are worthwhile before MVP release. - Discuss whether the remaining tasks are worthwhile before MVP release.

35
src/views/ContactsView.vue

@ -66,6 +66,10 @@
: "Unconfirmed" : "Unconfirmed"
}} }}
</button> </button>
<br />
(Only hours shown)
<br />
(Only recent shown)
</div> </div>
</div> </div>
@ -135,7 +139,10 @@
<fa icon="trash-can" class="fa-fw" /> <fa icon="trash-can" class="fa-fw" />
</button> </button>
<div v-if="!showGiveNumbers" class="ml-auto flex gap-1.5"> <div
v-if="showGiveNumbers && contact.did != activeDid"
class="ml-auto flex gap-1.5"
>
<button <button
class="text-sm uppercase bg-blue-600 text-white px-2 py-1.5 rounded-md" class="text-sm uppercase bg-blue-600 text-white px-2 py-1.5 rounded-md"
@click="onClickAddGive(activeDid, contact.did)" @click="onClickAddGive(activeDid, contact.did)"
@ -294,20 +301,28 @@ export default class ContactsView extends Vue {
} }
async loadGives() { async loadGives() {
const handleResponse = (resp, descriptions, confirmed, unconfirmed) => { const handleResponse = (
resp,
allData,
descriptions,
confirmed,
unconfirmed,
useRecipient,
) => {
if (resp.status === 200) { if (resp.status === 200) {
const allData = resp.data.data;
for (const give of allData) { for (const give of allData) {
const otherDid = useRecipient ? give.recipientDid : give.agentDid;
console.log("give from", otherDid, "is", give.amount, "HUR");
if (give.unit === "HUR") { if (give.unit === "HUR") {
if (give.amountConfirmed) { if (give.amountConfirmed) {
const prevAmount = confirmed[give.agentDid] || 0; const prevAmount = confirmed[otherDid] || 0;
confirmed[give.agentDid] = prevAmount + give.amount; confirmed[otherDid] = prevAmount + give.amount;
} else { } else {
const prevAmount = unconfirmed[give.agentDid] || 0; const prevAmount = unconfirmed[otherDid] || 0;
unconfirmed[give.agentDid] = prevAmount + give.amount; unconfirmed[otherDid] = prevAmount + give.amount;
} }
if (!descriptions[give.agentDid] && give.description) { if (!descriptions[otherDid] && give.description) {
descriptions[give.agentDid] = give.description; descriptions[otherDid] = give.description;
} }
} }
} }
@ -352,6 +367,7 @@ export default class ContactsView extends Vue {
givenByMeDescriptions, givenByMeDescriptions,
givenByMeConfirmed, givenByMeConfirmed,
givenByMeUnconfirmed, givenByMeUnconfirmed,
true,
); );
this.givenByMeDescriptions = givenByMeDescriptions; this.givenByMeDescriptions = givenByMeDescriptions;
this.givenByMeConfirmed = givenByMeConfirmed; this.givenByMeConfirmed = givenByMeConfirmed;
@ -365,6 +381,7 @@ export default class ContactsView extends Vue {
givenToMeDescriptions, givenToMeDescriptions,
givenToMeConfirmed, givenToMeConfirmed,
givenToMeUnconfirmed, givenToMeUnconfirmed,
false,
); );
this.givenToMeDescriptions = givenToMeDescriptions; this.givenToMeDescriptions = givenToMeDescriptions;
this.givenToMeConfirmed = givenToMeConfirmed; this.givenToMeConfirmed = givenToMeConfirmed;

Loading…
Cancel
Save