Browse Source

fix bad prompt if they choose to confirm, and use the right phrasing for singular "hour"

search-bbox
Trent Larson 1 year ago
parent
commit
06b173e861
  1. 19
      src/views/ContactsView.vue

19
src/views/ContactsView.vue

@ -461,7 +461,9 @@ export default class ContactsView extends Vue {
confirm( confirm(
"Are you sure you want to use one of your registrations for " + "Are you sure you want to use one of your registrations for " +
this.nameForDid(this.contacts, contact.did) + 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 they have unconfirmed amounts, ask to confirm those first
if (toDid == identity?.did && this.givenToMeUnconfirmed[fromDid] > 0) { 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 ( if (
confirm( confirm(
"There are " + "There " +
isare +
" " +
this.givenToMeUnconfirmed[fromDid] + this.givenToMeUnconfirmed[fromDid] +
" unconfirmed hours from them." + " unconfirmed " +
hours +
" from them." +
" Would you like to confirm some of those hours?", " Would you like to confirm some of those hours?",
) )
) { ) {
@ -704,6 +712,7 @@ export default class ContactsView extends Vue {
name: "contact-amounts", name: "contact-amounts",
query: { contactDid: fromDid }, query: { contactDid: fromDid },
}); });
return;
} }
} }
if (!this.isNumeric(this.hourInput)) { if (!this.isNumeric(this.hourInput)) {
@ -754,7 +763,9 @@ export default class ContactsView extends Vue {
confirm( confirm(
"Are you sure you want to record " + "Are you sure you want to record " +
this.hourInput + this.hourInput +
" hours " + " hour" +
(this.hourInput == "1" ? "" : "s") +
" " +
toFrom + toFrom +
description + description +
"?", "?",

Loading…
Cancel
Save