Skip to content

Commit

Permalink
display invalid type
Browse files Browse the repository at this point in the history
  • Loading branch information
vorujack committed Jan 7, 2024
1 parent dee4dc3 commit 60a82bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/qrcode/QrCodeReaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class QrCodeReaderView extends React.Component<
};

success = (scanned: string) => {
Toast.show({
text: scanned,
}).then(() => null);
let selectedTypes = Types.filter((item) => item.detect(scanned) !== null);
if (this.props.allowedTypes) {
const allowedTypes: Array<string> = this.props.allowedTypes;
Expand Down Expand Up @@ -153,6 +150,9 @@ class QrCodeReaderView extends React.Component<
this.props.wallet
);
}
Toast.show({
text: `No Renderer type detected for ${this.state.type}`,
}).then(() => null);
return null;
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/qrcode/qrcode-types/QrCodeMoreChunk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const QrCodeMoreChunk = (props: PropsType) => {
<h3>
{completed} / {props.chunks.length}
</h3>
<h2>Qrcode Type is: {props.type}</h2>
<h4>Qrcode Type is: {props.type}</h4>
<Button
variant="contained"
fullWidth
Expand Down
4 changes: 2 additions & 2 deletions src/components/qrcode/qrcode-types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Types = [
/>
),
type: TxSignR,
detect: (value: string) => detectPageFromJson(value, 'CSR'),
detect: (value: string) => detectPageFromJson(value, TxSignR),
},
{
render: (
Expand All @@ -90,7 +90,7 @@ const Types = [
/>
),
type: TxPublishR,
detect: (value: string) => detectPageFromJson(value, 'CSTX'),
detect: (value: string) => detectPageFromJson(value, TxPublishR),
},
{
render: (
Expand Down

0 comments on commit 60a82bb

Please sign in to comment.