From b512e6c5b54e74e7db8d220c818844cfe72000d4 Mon Sep 17 00:00:00 2001 From: Gellipapa Date: Sat, 28 Sep 2024 14:58:17 +0200 Subject: [PATCH] :ambulance: Fix label problem --- html/scripts/app.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/html/scripts/app.js b/html/scripts/app.js index b519ae8..26c2ed9 100644 --- a/html/scripts/app.js +++ b/html/scripts/app.js @@ -718,6 +718,16 @@ $(document).ready(function () { pincode.show(); } + function handleTransactionLabel(label, languageText){ + const defaultLabelList = { + WITHDRAW: languageText.withdraw, + DEPOSIT: languageText.deposit, + TRANSFER_RECEIVE: languageText.transferReceive + } + + return defaultLabelList[label.toUpperCase()] ?? label ?? languageText.transfer + } + $(document).on("click", ".pincode-numbers div", function () { if (pincode.getPincode().length + 1 == 4) { $(".pincode-numbers div:nth-child(12)").removeClass("disable-button"); @@ -766,6 +776,8 @@ $(document).ready(function () { transData.map((trans) => { trans.id = trans.time; trans.time = Utils.dateFormat(trans.time); + const currentLabel = handleTransactionLabel(trans.label, languageText) + trans.label = currentLabel; switch (trans.type) { case "WITHDRAW": trans.type = languageText.withdraw;