squared off qr scanner

This commit is contained in:
lemonknowsall committed 2025-10-27 23:01:13 -07:00
1 parent 5687faa746
commit 5d18a2acf1
3 files changed
+111 -38

No files matched your search

+4 -2
View File
@@ -45,7 +45,7 @@ export function CashuWallet() {
const { user } = useCurrentUser();
const { getInvoice: getLightningInvoice, isLoading: isResolvingAddress } = useLightningAddress();
const { toast } = useToast();
const { generateQRCode, isScanning, startScanning, stopScanning, error: qrError, classifyQRCode } = useQRCode();
const { generateQRCode, isScanning, startScanning, stopScanning, error: qrError, classifyQRCode, setModalOpen } = useQRCode();
const { copy: copyToClipboard } = useCopyToClipboard();
const { hasNsecAccess } = useNsecAccess();
@@ -336,12 +336,14 @@ export function CashuWallet() {
// Start/stop QR scanner when modal opens/closes
useEffect(() => {
if (showQRScanner) {
setModalOpen?.(true);
startScanning(handleQRScanResult);
} else {
setModalOpen?.(false);
stopScanning();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [showQRScanner, startScanning, stopScanning]);
}, [showQRScanner, startScanning, stopScanning, setModalOpen]);
// ============================================================================
// EFFECTS - Cleanup