tiny bit simplified

+6 -14
+1 -1
atproto-notifications/src/App.tsx
··· 13 13 14 14 {user === null 15 15 ? ( 16 - <WhoAmI onSetUser={setUser} /> 16 + <WhoAmI onIdentify={setUser} /> 17 17 ) 18 18 : ( 19 19 <>
+5 -13
atproto-notifications/src/components/WhoAmI.tsx
··· 1 1 import { useRef, useEffect } from 'react'; 2 2 3 - export function WhoAmI({ onSetUser, origin = 'http://127.0.0.1:9997' }) { 3 + export function WhoAmI({ onIdentify, origin = 'http://127.0.0.1:9997' }) { 4 4 const frameRef = useRef(null); 5 5 6 6 useEffect(() => { ··· 9 9 ev.source !== frameRef.current?.contentWindow || 10 10 ev.origin !== origin 11 11 ) return; 12 - onSetUser(ev.data); 12 + onIdentify(ev.data); 13 13 } 14 - 15 - console.log('ready'); 16 14 window.addEventListener('message', handleMessage); 17 - return () => { 18 - console.log('byeeeeeeeeeeeee'); 19 - window.removeEventListener('message', handleMessage); 20 - } 15 + return () => window.removeEventListener('message', handleMessage); 21 16 }, []); 22 17 23 18 return ( 24 19 <iframe 25 20 src={`${origin}/prompt`} 26 21 ref={frameRef} 27 - id="whoami" 22 + height="160" 23 + width="320" 28 24 style={{ 29 25 border: 'none', 30 - boxSizing: 'border-box', 31 26 display: 'block', 32 27 colorScheme: 'none', 33 28 }} 34 - allowtransparency="true" 35 - height="160" 36 - width="320" 37 29 > 38 30 Ooops, failed to load the login helper 39 31 </iframe>