Page MenuHomePhabricator

D13239.diff
No OneTemporary

D13239.diff

diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -71,6 +71,7 @@
localIDPrefix,
} from '../shared/message-utils.js';
import {
+ parsePendingThreadID,
threadHasPermission,
threadInChatList,
threadIsPending,
@@ -103,6 +104,7 @@
stateSyncPayloadTypes,
} from '../types/socket-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
+import { threadTypeIsThick } from '../types/thread-types-enum.js';
import type {
LegacyRawThreadInfo,
RawThreadInfos,
@@ -618,16 +620,27 @@
type: 'replace_threads',
payload: {
threads: Object.fromEntries(
- Object.entries(updatedThreads).map(([threadID, thread]) => [
- threadID,
- threadInfos[threadID].thick
- ? {
- ...thread,
- startReached:
- thread.messageIDs.length < defaultNumberPerThread,
- }
- : thread,
- ]),
+ Object.entries(updatedThreads).map(([threadID, thread]) => {
+ let isThreadThick;
+ if (threadInfos[threadID]) {
+ isThreadThick = threadInfos[threadID].thick;
+ } else {
+ const threadIDParseResult = parsePendingThreadID(threadID);
+ isThreadThick = threadIDParseResult
+ ? threadTypeIsThick(threadIDParseResult.threadType)
+ : false;
+ }
+ return [
+ threadID,
+ isThreadThick
+ ? {
+ ...thread,
+ startReached:
+ thread.messageIDs.length < defaultNumberPerThread,
+ }
+ : thread,
+ ];
+ }),
),
},
},

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 11:08 AM (19 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596755
Default Alt Text
D13239.diff (1 KB)

Event Timeline