Skip to content

Commit

Permalink
Merge pull request #147 from KeystoneHQ/update-animated-qr
Browse files Browse the repository at this point in the history
Update animated qr
  • Loading branch information
soralit authored May 22, 2024
2 parents 371cbf9 + 8f8a793 commit 2ce06ea
Show file tree
Hide file tree
Showing 3 changed files with 3,239 additions and 3,019 deletions.
3 changes: 1 addition & 2 deletions packages/animated-qr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keystonehq/animated-qr",
"version": "0.8.6",
"version": "0.9.0",
"description": "animated qr code and scanner",
"author": "LiYanLance <[email protected]>",
"homepage": "https://github.com/KeystoneHQ/keystone-airgaped-base#readme",
Expand All @@ -27,7 +27,6 @@
"test": "jest"
},
"dependencies": {
"@keystonehq/ur-decoder": "^0.12.2",
"@ngraveio/bc-ur": "^1.1.6",
"@zxing/browser": "^0.1.1",
"@zxing/library": "^0.19.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/animated-qr/src/AnimatedQRScanner/getAnimatedScan.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { URRegistryDecoder } from "@keystonehq/ur-decoder";
import { URDecoder } from "@ngraveio/bc-ur";
import { QRCodeError, ScannerProps } from "./types";
import { purposeToURType } from "./constant";

Expand All @@ -14,7 +14,7 @@ export const getAnimatedScan = ({
handleError,
onProgress,
}: Omit<ScannerProps, "Options">): ScannerHook => {
let urDecoder = new URRegistryDecoder();
let urDecoder = new URDecoder();
const handleScanSuccess = (data: string) => {
try {
urDecoder.receivePart(data);
Expand Down Expand Up @@ -45,11 +45,11 @@ export const getAnimatedScan = ({
} else {
handleError(QRCodeError.UNEXPECTED_QRCODE);
}
urDecoder = new URRegistryDecoder();
urDecoder = new URDecoder();
}
} catch (e) {
handleError(QRCodeError.INVALID_QR_CODE);
urDecoder = new URRegistryDecoder();
urDecoder = new URDecoder();
}
};

Expand Down
Loading

0 comments on commit 2ce06ea

Please sign in to comment.