Skip to content

Commit

Permalink
Added fix for qr code download link mismatch data type
Browse files Browse the repository at this point in the history
Signed-off-by: prasadgkalamkar <[email protected]>
  • Loading branch information
prasadgkalamkar committed Dec 17, 2024
1 parent 860e019 commit c55001f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commonComponents/QRcode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import domtoimage from 'dom-to-image';

const CustomQRCode = ({ value, size }: { value: string, size: number }) => {

const inputRef = useRef<HTMLInputElement>(null);
const node = document.createTextNode('');
const inputRef = useRef<Node>(node);
const [isCopied, setIsCopied] = useState(false);

function copyTextVal(e: React.MouseEvent<HTMLButtonElement>) {
Expand All @@ -24,7 +25,7 @@ const CustomQRCode = ({ value, size }: { value: string, size: number }) => {
}

const drawHtmlToCanvas = () => {
domtoimage.toJpeg(inputRef.current, { quality: 0.95 })
domtoimage.toJpeg(inputRef.current, { quality: 0.95 })
.then(function (dataUrl) {
var link = document.createElement('a');
link.download = 'my-image-name.jpeg';
Expand Down

0 comments on commit c55001f

Please sign in to comment.