Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 10 additions & 2 deletions packages/invoice-dashboard/src/lib/dashboard/invoice-view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
export let isRequestPayed: boolean;
let network = request?.currencyInfo?.network || "mainnet";
let currency = currencyManager.fromAddress(request?.currencyInfo?.value);
// FIXME: Use a non deprecated function
let currency = currencyManager.from(
request?.currencyInfo.value,
request?.currencyInfo.network
);
let statuses: any = [];
let isPaid = false;
let loading = false;
Expand Down Expand Up @@ -99,7 +103,11 @@
$: {
wallet = wallet;
network = request?.currencyInfo?.network || "mainnet";
currency = currencyManager.fromAddress(request?.currencyInfo?.value);
// FIXME: Use a non deprecated function
currency = currencyManager.from(
request?.currencyInfo.value,
request?.currencyInfo.network
);
Comment on lines +106 to +110
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Replace deprecated from method across the codebase

The currencyManager.from method is used in multiple places within the .svelte files, and it is marked as deprecated. Ensure that all instances are updated to use a non-deprecated function.

  • packages/invoice-dashboard/src/lib/view-requests.svelte: Multiple occurrences with FIXME comments.
  • packages/invoice-dashboard/src/lib/dashboard/invoice-view.svelte: Lines 106-110.
Analysis chain

Approved: Consistent use of updated currency handling method.

The consistent application of the new from method in the reactive statement ensures reliability and maintains code quality.

Verify that the reactive statement behaves as expected with the new method.

Run the following script to verify the behavior of the reactive statement:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify behavior of reactive statement using the `from` method.

# Test: Search for reactive statements using the `from` method. Expect: Correct behavior and no errors.
rg --type svelte -A 5 $':\s*currencyManager.from'

Length of output: 81


Script:

#!/bin/bash
# Description: Verify behavior of reactive statement using the `from` method.

# Test: Search for reactive statements using the `from` method in .svelte files. Expect: Correct behavior and no errors.
rg ':\s*currencyManager.from' --glob '*.svelte' -A 5

Length of output: 54


Script:

#!/bin/bash
# Description: Search for any usage of the `from` method in .svelte files.

# Test: Find all occurrences of `currencyManager.from` in .svelte files.
rg 'currencyManager\.from' --glob '*.svelte' -A 5

Length of output: 2934

}
const checkInvoice = async () => {
Expand Down
21 changes: 15 additions & 6 deletions packages/invoice-dashboard/src/lib/view-requests.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
type: Types.Identity.TYPE.ETHEREUM_ADDRESS,
value: signer,
});

requests = requestsData
?.map((request) => request.getData())
.sort((a, b) => b.timestamp - a.timestamp);
Expand Down Expand Up @@ -482,11 +483,17 @@
<td>
{formatUnits(
BigInt(request.expectedAmount),
currencyManager.fromAddress(request.currencyInfo.value)
?.decimals ?? 18
// FIXME: Use a non deprecated function
currencyManager.from(
request.currencyInfo.value,
request.currencyInfo.network
)?.decimals ?? 18
)}
{currencyManager.fromAddress(request.currencyInfo.value)
?.symbol}
<!-- FIXME: Use a non deprecated function -->
{currencyManager.from(
request.currencyInfo.value,
request.currencyInfo.network
)?.symbol}
</td>
<td> {checkStatus(request)}</td>
<td
Expand All @@ -496,8 +503,10 @@
try {
await exportToPDF(
request,
currencyManager.fromAddress(
request?.currencyInfo?.value
// FIXME: Use a non deprecated function
currencyManager.from(
request.currencyInfo.value,
request.currencyInfo.network
),
config.logo
);
Expand Down