fix qr code web

This commit is contained in:
2025-10-24 14:48:30 +02:00
parent 8356b04eb2
commit 0b37c7bc07
4 changed files with 62 additions and 10 deletions
+39 -6
View File
@@ -46,6 +46,7 @@ const ShareModal = ({ payload }) => {
const [copied, setCopied] = useState(false);
const copyTimeout = useRef(null);
const shareQrTimeoutRef = useRef(null);
const modalRef = useRef(null);
const [webVisible, setWebVisible] = useState(true);
const blurProps =
@@ -88,6 +89,7 @@ const ShareModal = ({ payload }) => {
if (copyTimeout.current) {
clearTimeout(copyTimeout.current);
}
};
}, []);
@@ -191,14 +193,45 @@ const ShareModal = ({ payload }) => {
const handleShareOption = useCallback(
async (option) => {
if (option?.type === "qr") {
await closeSheet();
setGlobal({
shareQrModal: {
visible: true,
console.log("share.modal.handleShareOption", {
key: option?.key,
platform: Platform.OS,
});
if (shareQrTimeoutRef.current) {
clearTimeout(shareQrTimeoutRef.current);
}
const openQrModal = () => {
console.log("share.modal.openQrModal", {
platform: Platform.OS,
url: qrUrl,
title: qrTitle,
},
});
});
shareQrTimeoutRef.current = null;
setGlobal({
shareQrModal: {
visible: true,
url: qrUrl,
title: qrTitle,
},
});
};
if (Platform.OS === "web") {
console.log("share.modal.scheduleQr", { platform: Platform.OS });
const maybePromise = closeSheet();
shareQrTimeoutRef.current = setTimeout(openQrModal, 80);
if (maybePromise && typeof maybePromise.catch === "function") {
maybePromise.catch((error) => {
console.error("share.modal.closeSheet.error", error);
});
}
} else {
await closeSheet();
openQrModal();
}
return;
}