Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3359311
D13551.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13551.diff
View Options
diff --git a/lib/shared/sidebar-utils.js b/lib/shared/sidebar-utils.js
--- a/lib/shared/sidebar-utils.js
+++ b/lib/shared/sidebar-utils.js
@@ -20,7 +20,11 @@
} from '../types/message-types.js';
import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
-import { threadTypes, threadTypeIsThick } from '../types/thread-types-enum.js';
+import {
+ threadTypes,
+ threadTypeIsThick,
+ threadTypeIsPersonal,
+} from '../types/thread-types-enum.js';
import type { LoggedInUserInfo } from '../types/user-types.js';
import type { GetENSNames } from '../utils/ens-helpers.js';
import {
@@ -76,11 +80,7 @@
}
const singleOtherUser = getSingleOtherUser(parentThreadInfo, viewerID);
- if (
- (parentThreadType === threadTypes.GENESIS_PERSONAL ||
- parentThreadType === threadTypes.PERSONAL) &&
- singleOtherUser
- ) {
+ if (threadTypeIsPersonal(parentThreadType) && singleOtherUser) {
const singleOtherUsername = parentThreadInfo.members.find(
member => member.id === singleOtherUser,
)?.username;
diff --git a/native/chat/message-list.react.js b/native/chat/message-list.react.js
--- a/native/chat/message-list.react.js
+++ b/native/chat/message-list.react.js
@@ -9,7 +9,7 @@
import { messageKey, useFetchMessages } from 'lib/shared/message-utils.js';
import { useWatchThread } from 'lib/shared/watch-thread-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { threadTypes } from 'lib/types/thread-types-enum.js';
+import { threadTypeIsPersonal } from 'lib/types/thread-types-enum.js';
import ChatList from './chat-list.react.js';
import type { ChatNavigationProp } from './chat.react.js';
@@ -197,10 +197,7 @@
const { messageListData, startReached } = this.props;
const footer = startReached ? this.ListFooterComponent : undefined;
let relationshipPrompt = null;
- if (
- this.props.threadInfo.type === threadTypes.GENESIS_PERSONAL ||
- this.props.threadInfo.type === threadTypes.PERSONAL
- ) {
+ if (threadTypeIsPersonal(this.props.threadInfo.type)) {
relationshipPrompt = (
<RelationshipPrompt
pendingPersonalThreadUserInfo={
diff --git a/web/chat/chat-message-list.react.js b/web/chat/chat-message-list.react.js
--- a/web/chat/chat-message-list.react.js
+++ b/web/chat/chat-message-list.react.js
@@ -17,7 +17,7 @@
threadOtherMembers,
} from 'lib/shared/thread-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { threadTypes } from 'lib/types/thread-types-enum.js';
+import { threadTypeIsPersonal } from 'lib/types/thread-types-enum.js';
import { defaultMaxTextAreaHeight, editBoxHeight } from './chat-constants.js';
import css from './chat-message-list.css';
@@ -294,10 +294,7 @@
const messages = messageListData.map(this.renderItem);
let relationshipPrompt = null;
- if (
- threadInfo.type === threadTypes.GENESIS_PERSONAL ||
- threadInfo.type === threadTypes.PERSONAL
- ) {
+ if (threadTypeIsPersonal(threadInfo.type)) {
const otherMembers = threadOtherMembers(
threadInfo.members,
this.props.viewerID,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 8:33 AM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579044
Default Alt Text
D13551.diff (3 KB)
Attached To
Mode
D13551: [lib][native][web] Use threadTypeIsPersonal where possible
Attached
Detach File
Event Timeline
Log In to Comment