Page MenuHomePhabricator

D13536.id44766.diff
No OneTemporary

D13536.id44766.diff

diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -1669,13 +1669,7 @@
);
}
-function useUserProfileThreadInfo(userInfo: ?UserInfo): ?UserProfileThreadInfo {
- const userID = userInfo?.id;
- const username = userInfo?.username;
-
- const loggedInUserInfo = useLoggedInUserInfo();
- const isViewerProfile = loggedInUserInfo?.id === userID;
-
+function useOldestPrivateThreadInfo(): ?ThreadInfo {
const genesisPrivateThreadInfosSelector = threadInfosSelectorForThreadType(
threadTypes.GENESIS_PRIVATE,
);
@@ -1686,11 +1680,21 @@
threadTypes.PRIVATE,
);
const privateThreadInfos = useSelector(privateThreadInfosSelector);
- const oldestPrivateThreadInfo = React.useMemo(
+ return React.useMemo(
() =>
getOldestCreated([...privateThreadInfos, ...genesisPrivateThreadInfos]),
[privateThreadInfos, genesisPrivateThreadInfos],
);
+}
+
+function useUserProfileThreadInfo(userInfo: ?UserInfo): ?UserProfileThreadInfo {
+ const userID = userInfo?.id;
+ const username = userInfo?.username;
+
+ const loggedInUserInfo = useLoggedInUserInfo();
+ const isViewerProfile = loggedInUserInfo?.id === userID;
+
+ const oldestPrivateThreadInfo = useOldestPrivateThreadInfo();
const usersWithPersonalThread = useSelector(usersWithPersonalThreadSelector);
const genesisPersonalThreadInfosSelector = threadInfosSelectorForThreadType(
@@ -1877,6 +1881,7 @@
useRoleNamesToSpecialRole,
useRoleUserSurfacedPermissions,
getThreadsToDeleteText,
+ useOldestPrivateThreadInfo,
useUserProfileThreadInfo,
assertAllThreadInfosAreLegacy,
useOnScreenEntryEditableThreadInfos,

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 9:15 AM (18 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543889
Default Alt Text
D13536.id44766.diff (1 KB)

Event Timeline