+5
-2
atproto-notifications/src/App.tsx
+5
-2
atproto-notifications/src/App.tsx
···
105
105
setPushPubkey(info.webPushPublicKey);
106
106
setWhoamiHost(info.whoamiHost);
107
107
setRole(info.role);
108
+
if (info.role === 'anonymous') {
109
+
setUser(null);
110
+
}
108
111
});
109
112
return <>Got server hello, updating app state…</>;
110
113
}
···
116
119
content = <Problem>your browser does not support registering push notifications.</Problem>
117
120
} else if (!whoamiHost) {
118
121
content = <GetJson endpoint='/hello' ok={info => <Blah info={info} />} />
119
-
} else if (!user || role === 'anonymous') {
122
+
} else if (!user) {
120
123
if (verif === 'verifying') content = <p><em>verifying…</em></p>;
121
124
else {
122
125
content = <WhoAmI onIdentify={onIdentify} origin={whoamiHost} />;
···
124
127
content = <><p>Sorry, failed to verify that identity. please let us know!</p>{content}</>;
125
128
}
126
129
}
127
-
} else if (permissionError !== null || notifPerm !== 'granted') {
130
+
} else if (permissionError !== null || notifPerm !== 'granted' || role === 'anonymous') {
128
131
content = (
129
132
<>
130
133
<h3>Step 2: Allow notifications</h3>