Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3306637
D11932.id39921.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11932.id39921.diff
View Options
diff --git a/lib/handlers/user-infos-handler.react.js b/lib/handlers/user-infos-handler.react.js
new file mode 100644
--- /dev/null
+++ b/lib/handlers/user-infos-handler.react.js
@@ -0,0 +1,34 @@
+// @flow
+
+import * as React from 'react';
+
+import { useSelector } from '../utils/redux-utils.js';
+import {
+ relyingOnAuthoritativeKeyserver,
+ usingCommServicesAccessToken,
+} from '../utils/services-utils.js';
+
+function UserInfosHandler(): React.Node {
+ const userInfos = useSelector(state => state.userStore.userInfos);
+
+ const userInfosWithMissingUsernames = React.useMemo(() => {
+ const entriesWithoutUsernames = Object.entries(userInfos).filter(
+ ([, value]) => !value.username,
+ );
+ return Object.fromEntries(entriesWithoutUsernames);
+ }, [userInfos]);
+
+ React.useEffect(() => {
+ if (!usingCommServicesAccessToken) {
+ return;
+ }
+ // 1. TODO: fetch usernames from identity
+
+ // 2. Fetch avatars and settings from auth keyserver
+ if (relyingOnAuthoritativeKeyserver) {
+ // TODO
+ }
+ }, [userInfosWithMissingUsernames]);
+}
+
+export { UserInfosHandler };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 8:43 PM (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2540076
Default Alt Text
D11932.id39921.diff (1 KB)
Attached To
Mode
D11932: [lib] Add UserInfosHandler
Attached
Detach File
Event Timeline
Log In to Comment