tangled
alpha
login
or
join now
bad-example.com
/
spacedust-utils
6
fork
atom
demos for spacedust
6
fork
atom
overview
issues
pulls
pipelines
whatever whatever
bad-example.com
8 months ago
fec08c20
4136aa14
+16
-2
2 changed files
expand all
collapse all
unified
split
atproto-notifications
src
components
WhoAmI.tsx
setup
WithServerHello.tsx
+2
-1
atproto-notifications/src/components/WhoAmI.tsx
···
17
17
18
18
return (
19
19
<iframe
20
20
-
src={`${origin}/prompt`}
20
20
+
src={`${origin}/prompt?app=notifications.microcosm.blue`}
21
21
+
referrerpolicy="strict-origin"
21
22
ref={frameRef}
22
23
height="180"
23
24
width="360"
+14
-1
atproto-notifications/src/components/setup/WithServerHello.tsx
···
17
17
// });
18
18
19
19
export function WithServerHello({ children }) {
20
20
+
const [whoamiKey, setWhoamiKey] = useState(0);
20
21
const [whoamiInfo, setWhoamiInfo] = useState(null);
21
22
22
23
const childrenFor = useCallback((did, role) => {
···
26
27
return 'hiiiiiiii ' + role;
27
28
})
28
29
30
30
+
const reloadConnect = useCallback(e => {
31
31
+
e.preventDefault();
32
32
+
setWhoamiKey(n => n + 1);
33
33
+
});
34
34
+
29
35
return (
30
36
<GetJson
31
37
/* todo: key on login state */
···
36
42
return whoamiInfo === null
37
43
? (
38
44
<Chrome>
39
39
-
<WhoAmI origin={whoamiHost} onIdentify={setWhoamiInfo} />
45
45
+
<WhoAmI
46
46
+
key={whoamiKey}
47
47
+
origin={whoamiHost}
48
48
+
onIdentify={setWhoamiInfo}
49
49
+
/>
50
50
+
<p style={{fontSize: '0.8rem'}}>
51
51
+
<a href="#" onClick={reloadConnect}>Reload connect prompt</a>
52
52
+
</p>
40
53
</Chrome>
41
54
) : (
42
55
<PostJson