Skip to content

Commit a8a77f1

Browse files
committed
fix: coderabbitai issues
1 parent be5ba80 commit a8a77f1

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
</p>
175175
<p class="invoice-section-title">
176176
<span>Settlement Currency</span>
177-
{currency? `${currency?.symbol} (${currency?.network})` : ""}
177+
{currency ? `${currency?.symbol} (${currency?.network})` : ""}
178178
</p>
179179
<p class="invoice-section-title">
180180
<span>Invoice Type</span>

packages/invoice-dashboard/src/utils/chainlink.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const getChainlinkRate = async (
3434
decimals: result.decimals.toString().length - 1,
3535
};
3636
} catch (e) {
37+
console.error('Error fetching Chainlink rate:', e);
3738
return null;
3839
}
3940
};

packages/invoice-dashboard/src/utils/generateInvoice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ export const exportToPDF = async (
8282
</div>
8383
8484
<div style="margin-bottom: 20px;">
85-
<strong>Payment Chain:</strong> ${paymentCurrencies[0]?.network || "-"}<br>
85+
<strong>Payment Chain:</strong> ${paymentCurrencies.length > 0 ? paymentCurrencies[0]?.network : "-"}<br>
8686
<strong>Invoice Currency:</strong> ${invoice.currency || "-"}<br>
87-
<strong>Settlement Currency:</strong> ${paymentCurrencies[0]?.symbol || "-"}<br>
87+
<strong>Settlement Currency:</strong> ${paymentCurrencies.length > 0 ? paymentCurrencies[0]?.symbol : "-"}<br>
8888
<strong>Invoice Type:</strong> Regular Invoice
8989
</div>
9090

shared/utils/currencyConversionPairs.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,17 +1163,29 @@ export const currencyConversionPairs = {
11631163
],
11641164
};
11651165

1166+
1167+
interface CurrencyConversionPair {
1168+
input: string;
1169+
outputs: string[];
1170+
}
1171+
1172+
interface FormattedCurrencyConversionPair {
1173+
[input: string]: {
1174+
[output: string]: number;
1175+
};
1176+
}
1177+
11661178
/**
11671179
* Converts currency conversion pair to currency manager format
11681180
*
11691181
* @param currencyConversionPair
11701182
* @returns formatted currency conversion pair for currency manager
11711183
*/
11721184

1173-
export const convertToCurrencyManagerFormat = (currencyConversionPair) => {
1174-
const result: any = {};
1185+
export const convertToCurrencyManagerFormat = (currencyConversionPair: CurrencyConversionPair[]): FormattedCurrencyConversionPair => {
1186+
const result: FormattedCurrencyConversionPair = {};
11751187
for (const pair of currencyConversionPair) {
1176-
const outputs: any = {};
1188+
const outputs: { [output: string]: number } = {};
11771189
for (const output of pair.outputs) {
11781190
outputs[output] = 1;
11791191
}

0 commit comments

Comments
 (0)