mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
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:
committed by
GitHub
parent
eb6af37ae0
commit
cb036e8502
@@ -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}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@selfxyz/qrcode",
|
||||
"version": "0.0.17",
|
||||
"version": "0.0.18",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/selfxyz/self"
|
||||
|
||||
Reference in New Issue
Block a user