Skip to content

Commit

Permalink
fix rendering defaultLogo in shared QR on iOS, minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
myxmaster committed Feb 3, 2025
1 parent 1421d1b commit cf7102b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 7 additions & 1 deletion components/CollapsedQR.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import {
Dimensions,
Image,
Platform,
StyleSheet,
Text,
Expand Down Expand Up @@ -50,7 +51,12 @@ const ForwardedQRCode = React.forwardRef<QRCodeElement, ExtendedQRCodeProps>(
getRef={(c) => {
if (c && c.toDataURL && !(ref as any).current) {
(ref as any).current = c;
props.parent?.setState({ qrReady: true });
Image.getSize(
Image.resolveAssetSource(defaultLogo).uri,
() => {
props.parent?.setState({ qrReady: true });
}
);
}
}}
/>
Expand Down
7 changes: 2 additions & 5 deletions components/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ export default class ShareButton extends React.Component<ShareButtonProps> {
shareContent = async () => {
const { value, qrRef, onShareComplete } = this.props;
try {
if (!qrRef?.current) {
return;
}
if (!qrRef?.current) return;

const svgElement = qrRef.current;
const base64Data = await captureRef(svgElement, {
const base64Data = await captureRef(qrRef.current, {
format: 'png',
quality: 1
});
Expand Down

0 comments on commit cf7102b

Please sign in to comment.