mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-06 00:37:23 +00:00
squared off qr scanner
This commit is contained in:
1 parent
5687faa746
commit
5d18a2acf1
3 files changed
+111
-38
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user