Skip to content

Commit

Permalink
fix: display pop-up error message on PaymentConfirmationMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
Seddik authored and vaab committed May 17, 2024
1 parent 758e75f commit 0498b1e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 29 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion src/components/MoneyTransferModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,33 @@
let dateBegin = Date.now()
let payment
this.$store.commit("setRequestLoadingAfterCreds", true)
try {
this.$store.commit("setRequestLoadingAfterCreds", true)
payment = await this.selectedRecipient.transfer(
this.amount.toString(),
this.message
)
} catch (err: any) {
if (err instanceof LokapiExc.PaymentConfirmationMissing) {
this.$modal.args.value[0].refreshTransaction()
this.close()
this.$msg.warning(
this.$gettext(
"The transaction was sent but no confirmation was received. "
) +
"<br/>" +
this.$gettext(
"Please make sure to double check in the transaction list " +
"if this transaction appears in the near future. "
) +
"<br/>" +
this.$gettext(
"Contact your administrator if it fails to show up."
),
false
)
return
}
if (err instanceof LokapiExc.InsufficientBalance) {
this.errors.balance = this.$gettext(
"Transaction was refused due to insufficient balance"
Expand Down
34 changes: 24 additions & 10 deletions src/i18n/fr-FR/app.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ msgstr ""
msgid "%{ appName } version %{ appVersion }"
msgstr "%{ appName } version %{ appVersion }"

#: src/components/MoneyTransferModal.vue:500
#: src/components/MoneyTransferModal.vue:520
msgid "%{ name } was added to your favorite list"
msgstr "%{ name } a bien été ajouté en favori"

Expand Down Expand Up @@ -55,15 +55,15 @@ msgstr "Comptes en attente de validation"
msgid "Action"
msgstr "Action"

#: src/components/MoneyTransferModal.vue:485
#: src/components/MoneyTransferModal.vue:505
msgid "Add"
msgstr "Ajouter"

#: src/components/MoneyTransferModal.vue:192
msgid "Add a memo (optional)"
msgstr "Ajoutez un texte (optionnel)"

#: src/components/MoneyTransferModal.vue:479
#: src/components/MoneyTransferModal.vue:499
msgid "Add as favorite"
msgstr "Ajouter aux favoris"

Expand Down Expand Up @@ -136,7 +136,7 @@ msgstr ""
"Il y a eu un problème lors de la tentative de téléchargement de la liste des "
"transactions"

#: src/components/MoneyTransferModal.vue:449
#: src/components/MoneyTransferModal.vue:469
msgid ""
"An unexpected issue occurred during the money transfer. We are sorry for the "
"inconvenience."
Expand Down Expand Up @@ -304,6 +304,10 @@ msgstr "Confirmez votre mot de passe"
msgid "Connection successful"
msgstr "Connection réussie"

#: src/components/MoneyTransferModal.vue:443
msgid "Contact your administrator if it fails to show up."
msgstr "Contactez votre administrateur si elle ne s'affiche pas"

#: src/components/CreateAccount.vue:145 src/components/CreateAccount.vue:65
#: src/components/TheNavBar.vue:86 src/router/index.ts:50
msgid "Create my wallet"
Expand Down Expand Up @@ -344,7 +348,7 @@ msgstr[1] "chiffres"
msgid "Discard"
msgstr "Annuler"

#: src/components/MoneyTransferModal.vue:480
#: src/components/MoneyTransferModal.vue:500
msgid "Do you want to add %{ name } to your favorite list ?"
msgstr "Voulez vous ajouter %{ name } aux favoris ?"

Expand Down Expand Up @@ -454,7 +458,7 @@ msgstr "Préférences de langue"
msgid "Lastname"
msgstr "Nom"

#: src/components/MoneyTransferModal.vue:486
#: src/components/MoneyTransferModal.vue:506
msgid "Later"
msgstr "Plus tard"

Expand Down Expand Up @@ -630,6 +634,12 @@ msgstr ""
"Veuillez remplir les champs ci-dessous et cliquer sur le bouton Inscription "
"pour créer votre compte."

#: src/components/MoneyTransferModal.vue:438
msgid ""
"Please make sure to double check in the transaction list if this transaction "
"appears in the near future. "
msgstr "Pensez à vérifier dans la liste des transactions si votre transaction y apparaît bien."

#: src/components/CreateAccount.vue:52
msgid ""
"Please note that this password can not be retrieved, so be sure to keep it "
Expand Down Expand Up @@ -797,7 +807,7 @@ msgstr "Source"
msgid "Target"
msgstr "Destination"

#: src/components/MoneyTransferModal.vue:438
#: src/components/MoneyTransferModal.vue:458
msgid "Target account is inactive."
msgstr "Le compte destinataire du tranfert est désactivé."

Expand Down Expand Up @@ -862,6 +872,10 @@ msgstr "Votre demande de rechargement a été supprimée"
msgid "The Top-up request has been successfully payed"
msgstr "Votre demande de rechargement a été traitée avec succès"

#: src/components/MoneyTransferModal.vue:434
msgid "The transaction was sent but no confirmation was received. "
msgstr "La transaction a été envoyée mais aucune confirmation n'a été reçue."

#: src/views/Signup.vue:231 src/views/Signup.vue:242 src/views/Signup.vue:249
msgid "This fiels can not be empty."
msgstr "Ce champs est obligatoire."
Expand Down Expand Up @@ -978,7 +992,7 @@ msgstr "Opération traitée"
msgid "Transaction sent"
msgstr "Opération envoyée"

#: src/components/MoneyTransferModal.vue:431
#: src/components/MoneyTransferModal.vue:451
msgid "Transaction was refused due to insufficient balance"
msgstr "Transaction refusée en raison de fonds insuffisants"

Expand Down Expand Up @@ -1103,7 +1117,7 @@ msgid "You can not transfer money to your own account"
msgstr "Vous ne pouvez pas envoyer de l'argent vers votre propre compte."

#: src/components/MoneyTransferModal.vue:394
#: src/components/MoneyTransferModal.vue:454
#: src/components/MoneyTransferModal.vue:474
msgid ""
"You can try again. If the issue persists, please contact your administrator."
msgstr ""
Expand All @@ -1120,7 +1134,7 @@ msgstr ""
"Vous pouvez essayer de recharger la page, ou contacter votre administrateur "
"si l'erreur persiste."

#: src/components/MoneyTransferModal.vue:440
#: src/components/MoneyTransferModal.vue:460
msgid "You can't send money to this account."
msgstr "Vous ne pouvez pas envoyer de l'argent vers ce compte."

Expand Down
21 changes: 9 additions & 12 deletions src/services/toastService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ToastService {
private show(
message: string,
type: string,
duration: boolean | number = this.duration
duration: false | number = this.duration
) {
const toaster = createToaster({
type,
Expand All @@ -16,20 +16,17 @@ class ToastService {
})
toaster.show(message)
}
public error_Persistant(message: string) {
this.show(message, "error", false)
public error(message: string, duration?: false | number) {
this.show(message, "error", duration)
}
public error(message: string) {
this.show(message, "error")
public warning(message: string, duration?: false | number) {
this.show(message, "warning", duration)
}
public warning(message: string) {
this.show(message, "warning")
public success(message: string, duration?: false | number) {
this.show(message, "success", duration)
}
public success(message: string) {
this.show(message, "success")
}
public info(message: string) {
this.show(message, "info")
public info(message: string, duration?: false | number) {
this.show(message, "info", duration)
}
}

Expand Down

0 comments on commit 0498b1e

Please sign in to comment.