Page MenuHomePhabricator

D13551.diff
No OneTemporary

D13551.diff

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

Mime Type
text/plain
Expires
Wed, Oct 2, 2:52 PM (19 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2217567
Default Alt Text
D13551.diff (3 KB)

Event Timeline