Fix rendering issue (#507)

* fix sdk import

* fix core react sdk version issue

* bump version

* bump version and fix rendering issue in the qrcode
This commit is contained in:
turnoffthiscomputer
2025-04-05 03:21:15 -04:00
committed by GitHub
parent eb6af37ae0
commit cb036e8502
2 changed files with 12 additions and 6 deletions

View File

@@ -44,11 +44,15 @@ const SelfQRcode = ({
}: SelfQRcodeProps) => {
const [proofStep, setProofStep] = useState(QRcodeSteps.WAITING_FOR_MOBILE);
const [proofVerified, setProofVerified] = useState(false);
const [sessionId, setSessionId] = useState(uuidv4());
const [sessionId, setSessionId] = useState('');
const socketRef = useRef<ReturnType<typeof initWebSocket> | null>(null);
useEffect(() => {
// Only initialize if we don't have a socket already
if (!socketRef.current) {
setSessionId(uuidv4());
}, []);
useEffect(() => {
if (sessionId && !socketRef.current) {
console.log('[QRCode] Initializing new WebSocket connection');
socketRef.current = initWebSocket(
websocketUrl,
@@ -69,9 +73,11 @@ const SelfQRcode = ({
socketRef.current = null;
}
};
}, [type, websocketUrl, onSuccess, selfApp]);
}, [sessionId, type, websocketUrl, onSuccess, selfApp]);
const socketRef = useRef<ReturnType<typeof initWebSocket> | null>(null);
if (!sessionId) {
return null;
}
const renderProofStatus = () => (
<div style={containerStyle}>

View File

@@ -1,6 +1,6 @@
{
"name": "@selfxyz/qrcode",
"version": "0.0.17",
"version": "0.0.18",
"repository": {
"type": "git",
"url": "https://github.com/selfxyz/self"