Skip to content

Commit

Permalink
Merge pull request #788 from BoltzExchange/fix-mobile-qr
Browse files Browse the repository at this point in the history
Fix mobile qr
  • Loading branch information
michael1011 authored Jan 6, 2025
2 parents 7ec2580 + 1cfa933 commit 12f9b6a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 37 deletions.
2 changes: 1 addition & 1 deletion src/components/DownloadRefund.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DownloadRefund = () => {
swap: { id: string } & Record<string, unknown>,
) => {
QRCode.toDataURL(JSON.stringify(swap), {
width: 1200,
width: 2500,
errorCorrectionLevel: "L",
})
.then((url: string) => {
Expand Down
7 changes: 0 additions & 7 deletions src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ const dict = {
will_receive: "Will receive",
refund_available_in: "Refund will be available in {{ blocks }} blocks",
no_wallet_connected: "No wallet connected",
qr_scan_supported: "This browser doesn't support refunds via QR",
},
de: {
language: "Deutsch",
Expand Down Expand Up @@ -467,8 +466,6 @@ const dict = {
will_receive: "Sie erhalten",
refund_available_in: "Rückerstattung möglich in {{ blocks }} Blöcken",
no_wallet_connected: "Kein Wallet verbunden",
qr_scan_supported:
"Dieser Browser unterstützt keine Erstattungen über QR",
},
es: {
language: "Español",
Expand Down Expand Up @@ -704,8 +701,6 @@ const dict = {
will_receive: "Recibirá",
refund_available_in: "Reembolso disponible en {{ blocks }} bloques",
no_wallet_connected: "No hay monedero conectado",
qr_scan_supported:
"Este navegador no admite devoluciones a través de QR",
},
zh: {
language: "中文",
Expand Down Expand Up @@ -915,7 +910,6 @@ const dict = {
will_receive: "将收到",
refund_available_in: "退款将分 {{ blocks }} 区块提供",
no_wallet_connected: "未连接钱包",
qr_scan_supported: "此浏览器不支持通过 QR 退款",
},
ja: {
language: "日本語",
Expand Down Expand Up @@ -1150,7 +1144,6 @@ const dict = {
will_receive: "受信予定",
refund_available_in: "返金は {{ blocks }} つのブロックに分かれる",
no_wallet_connected: "財布はつながっていない!",
qr_scan_supported: "このブラウザはQRによる払い戻しに対応していません。",
},
};

Expand Down
10 changes: 0 additions & 10 deletions src/pages/Refund.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ import {
LogRefundData,
scanLogsForPossibleRefunds,
} from "../utils/contractLogs";
import { qrScanProbe } from "../utils/qrScanProbe";
import { validateRefundFile } from "../utils/refundFile";
import { SomeSwap } from "../utils/swapCreator";
import ErrorWasm from "./ErrorWasm";

enum RefundError {
InvalidData,
QrScanNotSupported,
}

const Refund = () => {
Expand Down Expand Up @@ -77,11 +75,6 @@ const Refund = () => {
setRefundInvalid(undefined);

if (["image/png", "image/jpg", "image/jpeg"].includes(inputFile.type)) {
if (!(await qrScanProbe())) {
setRefundInvalid(RefundError.QrScanNotSupported);
return;
}

try {
const res = await QrScanner.scanImage(inputFile, {
returnDetailedScanResult: true,
Expand Down Expand Up @@ -264,9 +257,6 @@ const Refund = () => {
switch (refundInvalid()) {
case RefundError.InvalidData:
return t("invalid_refund_file");

case RefundError.QrScanNotSupported:
return t("qr_scan_supported");
}
})()}
</button>
Expand Down
19 changes: 0 additions & 19 deletions src/utils/qrScanProbe.ts

This file was deleted.

0 comments on commit 12f9b6a

Please sign in to comment.