|
@ -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; |
|
|