Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3408609
D8045.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
D8045.diff
View Options
diff --git a/lib/shared/avatar-utils.js b/lib/shared/avatar-utils.js
--- a/lib/shared/avatar-utils.js
+++ b/lib/shared/avatar-utils.js
@@ -14,10 +14,11 @@
ClientEmojiAvatar,
ClientAvatar,
ResolvedClientAvatar,
+ GenericUserInfoWithAvatar,
} from '../types/avatar-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
import { type RawThreadInfo, type ThreadInfo } from '../types/thread-types.js';
-import type { UserInfos, UserInfo } from '../types/user-types.js';
+import type { UserInfos } from '../types/user-types.js';
import { useSelector } from '../utils/redux-utils.js';
const defaultAnonymousUserEmojiAvatar: ClientEmojiAvatar = {
@@ -250,9 +251,7 @@
};
}
-function getAvatarForUser(
- user: ?{ +avatar?: ?ClientAvatar, +username?: ?string, ... },
-): ClientAvatar {
+function getAvatarForUser(user: ?GenericUserInfoWithAvatar): ClientAvatar {
if (user?.avatar) {
return user.avatar;
}
@@ -318,7 +317,7 @@
function useENSResolvedAvatar(
avatarInfo: ClientAvatar,
- userInfo: ?UserInfo,
+ userInfo: ?GenericUserInfoWithAvatar,
): ResolvedClientAvatar {
const ethAddress = React.useMemo(
() => getETHAddressForUserInfo(userInfo),
diff --git a/lib/types/avatar-types.js b/lib/types/avatar-types.js
--- a/lib/types/avatar-types.js
+++ b/lib/types/avatar-types.js
@@ -67,3 +67,9 @@
export type UpdateUserAvatarResponse = {
+updates: CreateUpdatesResult,
};
+
+export type GenericUserInfoWithAvatar = {
+ +username?: ?string,
+ +avatar?: ?ClientAvatar,
+ ...
+};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 12:04 PM (16 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2617008
Default Alt Text
D8045.diff (1 KB)
Attached To
Mode
D8045: [lib] Introduce new GenericUserInfoWithAvatar type
Attached
Detach File
Event Timeline
Log In to Comment