Skip to content

Commit

Permalink
Merge pull request #41 from Gellipapa/main
Browse files Browse the repository at this point in the history
🚑 Fix label problem
  • Loading branch information
Gellipapa authored Sep 28, 2024
2 parents 3d80afa + b512e6c commit aed4fd6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions html/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit aed4fd6

Please sign in to comment.