From 25b9dce669f4ce407ae36de4f443f0f8d04824a2 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 25 Mar 2023 19:47:36 -0600 Subject: [PATCH] fix the on-screen total update for unconfirmed amount --- src/views/ContactsView.vue | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 86ab9c87..574efe33 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -755,17 +755,13 @@ export default class ContactsView extends Vue { this.alertMessage = "Successfully logged time to the server."; this.isAlertVisible = true; if (fromDid === identity.did) { - this.givenByMeConfirmed[toDid] = - this.givenByMeConfirmed[toDid] + amount; - // do this to update the UI (is there a better way?) - // eslint-disable-next-line no-self-assign - this.givenByMeConfirmed = this.givenByMeConfirmed; + const newList = R.clone(this.givenByMeUnconfirmed); + newList[toDid] = (newList[toDid] || 0) + amount; + this.givenByMeUnconfirmed = newList; } else { - this.givenToMeConfirmed[fromDid] = - this.givenToMeConfirmed[fromDid] + amount; - // do this to update the UI (is there a better way?) - // eslint-disable-next-line no-self-assign - this.givenToMeConfirmed = this.givenToMeConfirmed; + const newList = R.clone(this.givenToMeConfirmed); + newList[fromDid] = (newList[fromDid] || 0) + amount; + this.givenToMeConfirmed = newList; } } } catch (error) {