Skip to content

Commit 341bae5

Browse files
committed
enable to use url
1 parent f850baa commit 341bae5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkgs/frontend/app/components/common/QrAddressReader.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export const QrAddressReader: FC<QrAddressReaderProps> = ({
8686
let scannedText = result.getText();
8787
if (scannedText.includes(":")) {
8888
scannedText = scannedText.split(":")[1];
89+
} else if (scannedText.includes("http")) {
90+
// get recipient query param from url
91+
const url = new URL(scannedText);
92+
const recipientParam = url.searchParams.get("recipient");
93+
if (recipientParam) {
94+
scannedText = recipientParam;
95+
}
8996
}
9097

9198
// Validate if it's a valid Ethereum address

0 commit comments

Comments
 (0)