Skip to content

Commit db532cf

Browse files
committed
Fixes per CodeRabbit comments
1 parent d4ceaed commit db532cf

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

packages/create-invoice-form/src/lib/create-invoice-form.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
let defaultCurrencies = currencyManager.knownCurrencies.filter(
7878
(currency: CurrencyTypes.CurrencyDefinition) =>
7979
currency.type === Types.RequestLogic.CURRENCY.ISO4217 ||
80-
(network ? currency.network === network : true)
80+
network ? currency.network === network : true
8181
);
8282
8383
const handleInvoiceCurrencyChange = (

packages/create-invoice-form/src/lib/utils/prepareRequest.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,12 @@ export const prepareRequestParams = ({
118118
invoiceCurrency.decimals
119119
).toString(),
120120
discount:
121-
item.discount != null &&
122-
parseUnits(
121+
item.discount != null
122+
? parseUnits(
123123
item.discount.toString(),
124124
invoiceCurrency.decimals
125-
).toString(),
125+
).toString()
126+
: undefined,
126127
tax: {
127128
type: "percentage",
128129
amount: item.tax.amount.toString(),

packages/invoice-dashboard/src/lib/dashboard/invoice-view.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
249249
return (
250250
(paymentNetworkExtension?.id &&
251-
approvalCheckers[paymentNetworkExtension.id]?.()) ||
251+
await approvalCheckers[paymentNetworkExtension.id]?.()) ||
252252
false
253253
);
254254
};

shared/utils/generateInvoice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ export const exportToPDF = async (
108108
</div>
109109
110110
<div style="margin-bottom: 20px; font-size: 10px;">
111-
<strong>Payment Chain:</strong> ${paymentCurrencies && paymentCurrencies[0] && paymentCurrencies[0].network ? paymentCurrencies[0].network : "-"}<br>
111+
<strong>Payment Chain:</strong> ${paymentCurrencies?.[0]?.network ?? "-"}<br>
112112
<strong>Invoice Currency:</strong> ${invoice.currency || "-"}<br>
113-
<strong>Settlement Currency:</strong> ${paymentCurrencies && paymentCurrencies[0] && paymentCurrencies[0].symbol ? paymentCurrencies[0].symbol : "-"}<br>
113+
<strong>Settlement Currency:</strong> ${paymentCurrencies?.[0]?.symbol ?? "-"}<br>
114114
</div>
115115
116116
<table>

0 commit comments

Comments
 (0)