Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
fix: trim prefix of scanned QR code data (#222)
Browse files Browse the repository at this point in the history
Because some QR codes have a prefix like "bitcoin:" or "litecoin:" this
commit causes all prefixes to be removed after a QR code is scanned.
  • Loading branch information
michael1011 authored Sep 28, 2019
1 parent e0ce5c3 commit 358b319
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/inputarea/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class InputArea extends React.Component {
if (data !== null) {
console.log(`Scanned QR code: ${data}`);

if (data.includes(':')) {
data = data.split(':')[1];
}

this.props.onChange(data);

this.setState({
Expand Down

0 comments on commit 358b319

Please sign in to comment.