Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show Time rem only when status is PENDING #530

Merged
merged 4 commits into from
May 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions bot/modules/orders/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ exports.listOrdersResponse = async (orders, i18n) => {

if (typeof order.amount !== 'undefined') amount = order.amount;
const timeToExpire = getTimeToExpirationOrder(order, i18n);
return [
[''].join(''),
['`Id `: ', '`', order.id, '`'].join(''),
['`Status `: ', '`', status, '`'].join(''),
['`Time rem`: ', '`', timeToExpire, '`'].join(''),
['`Sats amt`: ', '`', amount, '`'].join(''),
['`Fiat amt`: ', '`', fiatAmount, '`'].join(''),
['`Fiat `: ', '`', order.fiat_code, '`'].join(''),
['`Channel `: ', '`', sanitizeMD(channel), '`'].join(''),
['`_________________________________`'].join(''),
].join('\n');
let details=[
[""].join(""),
["`Id `: ", "`", order.id, "`"].join(""),
["`Status `: ", "`", status, "`"].join(""),
["`Sats amt`: ", "`", amount, "`"].join(""),
["`Fiat amt`: ", "`", fiatAmount, "`"].join(""),
["`Fiat `: ", "`", order.fiat_code, "`"].join(""),
["`Channel `: ", "`", sanitizeMD(channel), "`"].join(""),
["`_________________________________`"].join(""),
]
if (status === "PENDING") {
details.splice(3,0,["`Time rem`: ", "`", timeToExpire, "`"].join(""))
}
return details.join("\n");
});
const lines = await Promise.all(tasks);
const body = lines.join('\n');
Expand Down