Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351403
D13874.id45690.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
547 B
Referenced Files
None
Subscribers
None
D13874.id45690.diff
View Options
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
@@ -227,10 +227,11 @@
threadInfo: ?ThreadInfo,
permission: ThreadPermission,
): boolean {
- const threads = useThreadsWithPermission(
- threadInfo ? [threadInfo] : [],
- permission,
+ const threadInfos = React.useMemo(
+ () => (threadInfo ? [threadInfo] : []),
+ [threadInfo],
);
+ const threads = useThreadsWithPermission(threadInfos, permission);
return threads.length === 1;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 1:25 AM (21 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573410
Default Alt Text
D13874.id45690.diff (547 B)
Attached To
Mode
D13874: [lib] Avoid creating new array on every invocation of useThreadHasPermission
Attached
Detach File
Event Timeline
Log In to Comment