+2
-1
atproto-notifications/src/components/WhoAmI.tsx
+2
-1
atproto-notifications/src/components/WhoAmI.tsx
+14
-1
atproto-notifications/src/components/setup/WithServerHello.tsx
+14
-1
atproto-notifications/src/components/setup/WithServerHello.tsx
···
17
17
// });
18
18
19
19
export function WithServerHello({ children }) {
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
+
const reloadConnect = useCallback(e => {
31
+
e.preventDefault();
32
+
setWhoamiKey(n => n + 1);
33
+
});
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
-
<WhoAmI origin={whoamiHost} onIdentify={setWhoamiInfo} />
45
+
<WhoAmI
46
+
key={whoamiKey}
47
+
origin={whoamiHost}
48
+
onIdentify={setWhoamiInfo}
49
+
/>
50
+
<p style={{fontSize: '0.8rem'}}>
51
+
<a href="#" onClick={reloadConnect}>Reload connect prompt</a>
52
+
</p>
40
53
</Chrome>
41
54
) : (
42
55
<PostJson