Page MenuHomePhabricator

D11932.diff
No OneTemporary

D11932.diff

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

Mime Type
text/plain
Expires
Tue, Nov 19, 6:19 PM (21 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2540076
Default Alt Text
D11932.diff (1 KB)

Event Timeline