From 06b173e86184c703fa3786f1046cece086bc3496 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Mon, 4 Sep 2023 19:55:58 -0600 Subject: [PATCH] fix bad prompt if they choose to confirm, and use the right phrasing for singular "hour" --- src/views/ContactsView.vue | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 20553e6..f7e4301 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -461,7 +461,9 @@ export default class ContactsView extends Vue { confirm( "Are you sure you want to use one of your registrations for " + this.nameForDid(this.contacts, contact.did) + - (contact.registered ? " -- especially since they are already marked as registered" : "") + + (contact.registered + ? " -- especially since they are already marked as registered" + : "") + "?", ) ) { @@ -692,11 +694,17 @@ export default class ContactsView extends Vue { // if they have unconfirmed amounts, ask to confirm those first if (toDid == identity?.did && this.givenToMeUnconfirmed[fromDid] > 0) { + const isare = this.givenToMeUnconfirmed[fromDid] == 1 ? "is" : "are"; + const hours = this.givenToMeUnconfirmed[fromDid] == 1 ? "hour" : "hours"; if ( confirm( - "There are " + + "There " + + isare + + " " + this.givenToMeUnconfirmed[fromDid] + - " unconfirmed hours from them." + + " unconfirmed " + + hours + + " from them." + " Would you like to confirm some of those hours?", ) ) { @@ -704,6 +712,7 @@ export default class ContactsView extends Vue { name: "contact-amounts", query: { contactDid: fromDid }, }); + return; } } if (!this.isNumeric(this.hourInput)) { @@ -754,7 +763,9 @@ export default class ContactsView extends Vue { confirm( "Are you sure you want to record " + this.hourInput + - " hours " + + " hour" + + (this.hourInput == "1" ? "" : "s") + + " " + toFrom + description + "?",