Page MenuHomePhabricator

D8045.diff
No OneTemporary

D8045.diff

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

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)

Event Timeline