Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32166363
D4334.1765051197.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4334.1765051197.diff
View Options
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
@@ -97,19 +97,19 @@
const _mapValuesWithKeys = _mapValues.convert({ cap: false });
// Input must already be ordered!
-function threadsToMessageIDsFromMessageInfos(
+function mapThreadsToMessageIDsFromOrderedMessageInfos(
orderedMessageInfos: $ReadOnlyArray<RawMessageInfo>,
): { [threadID: string]: string[] } {
- const threads: { [threadID: string]: string[] } = {};
+ const threadsToMessageIDs: { [threadID: string]: string[] } = {};
for (const messageInfo of orderedMessageInfos) {
const key = messageID(messageInfo);
- if (!threads[messageInfo.threadID]) {
- threads[messageInfo.threadID] = [key];
+ if (!threadsToMessageIDs[messageInfo.threadID]) {
+ threadsToMessageIDs[messageInfo.threadID] = [key];
} else {
- threads[messageInfo.threadID].push(key);
+ threadsToMessageIDs[messageInfo.threadID].push(key);
}
}
- return threads;
+ return threadsToMessageIDs;
}
function isThreadWatched(
@@ -144,7 +144,7 @@
payload: { id: messageID(messageInfo), messageInfo },
}));
- const threadsToMessageIDs = threadsToMessageIDsFromMessageInfos(
+ const threadsToMessageIDs = mapThreadsToMessageIDsFromOrderedMessageInfos(
orderedMessageInfos,
);
const lastPruned = Date.now();
@@ -406,7 +406,7 @@
)(unshimmedNewMessagesOfWatchedThreads);
const newMessageOps: MessageStoreOperation[] = [];
- const threadsToMessageIDs = threadsToMessageIDsFromMessageInfos(
+ const threadsToMessageIDs = mapThreadsToMessageIDsFromOrderedMessageInfos(
orderedNewMessageInfos,
);
const oldMessageInfosToCombine = [];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 7:59 PM (20 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840529
Default Alt Text
D4334.1765051197.diff (1 KB)
Attached To
Mode
D4334: [lib] Rename `threadsToMessageIDsFromMessageInfos` to `mapThreadsToMessageIDsFromOrderedMessageInfos`
Attached
Detach File
Event Timeline
Log In to Comment