Page MenuHomePhabricator

D11916.diff
No OneTemporary

D11916.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
@@ -201,7 +201,7 @@
);
}
-function useThreadInChatList(threadInfo: ?ThreadInfo): boolean {
+function useIsThreadInChatList(threadInfo: ?ThreadInfo): boolean {
const threadIsVisible = useThreadHasPermission(
threadInfo,
threadPermissions.VISIBLE,
@@ -1918,7 +1918,7 @@
useThreadHasPermission,
viewerIsMember,
threadInChatList,
- useThreadInChatList,
+ useIsThreadInChatList,
threadIsTopLevel,
threadIsChannel,
threadIsSidebar,
diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js
--- a/native/chat/settings/thread-settings.react.js
+++ b/native/chat/settings/thread-settings.react.js
@@ -27,9 +27,9 @@
import { getAvailableRelationshipButtons } from 'lib/shared/relationship-utils.js';
import {
getSingleOtherUser,
- threadInChatList,
threadIsChannel,
useThreadHasPermission,
+ useIsThreadInChatList,
viewerIsMember,
} from 'lib/shared/thread-utils.js';
import threadWatcher from 'lib/shared/thread-watcher.js';
@@ -1163,15 +1163,16 @@
reduxThreadInfo ?? props.route.params.threadInfo;
const resolvedThreadInfo = useResolvedThreadInfo(threadInfo);
+ const isThreadInChatList = useIsThreadInChatList(threadInfo);
React.useEffect(() => {
- if (threadInChatList(threadInfo)) {
+ if (isThreadInChatList) {
return undefined;
}
threadWatcher.watchID(threadInfo.id);
return () => {
threadWatcher.removeID(threadInfo.id);
};
- }, [threadInfo]);
+ }, [isThreadInChatList, threadInfo.id]);
const parentThreadID = threadInfo.parentThreadID;
const parentThreadInfo: ?ThreadInfo = useSelector(state =>
diff --git a/web/chat/thread-list-provider.js b/web/chat/thread-list-provider.js
--- a/web/chat/thread-list-provider.js
+++ b/web/chat/thread-list-provider.js
@@ -15,7 +15,7 @@
getThreadListSearchResults,
useThreadListSearch,
threadIsPending,
- useThreadInChatList,
+ useIsThreadInChatList,
} from 'lib/shared/thread-utils.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
@@ -66,7 +66,7 @@
(activeTab === 'Focus' && activeTopLevelThreadIsFromHomeTab) ||
(activeTab === 'Background' && !activeTopLevelThreadIsFromHomeTab);
- const activeTopLevelThreadIsInChatList = useThreadInChatList(
+ const activeTopLevelThreadIsInChatList = useIsThreadInChatList(
activeTopLevelThreadInfo,
);

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 12:27 AM (21 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2587035
Default Alt Text
D11916.diff (2 KB)

Event Timeline