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