HomePhabricator
Diffusion Comm 77ed3c708135

[lib] Extract initialChatThreadItem

Description

[lib] Extract initialChatThreadItem

Summary:
This diff extracts some code for determining the initial ChatThreadItem to display while the Promise returned by getFinalChatThreadItem is resolving.

The code is currently in useChatThreadItems, which is the only current caller of useCreateChatThreadItem. In a later diff, we'll be introducing another caller of useCreateChatThreadItem that also needs this.

To share the code, this diff moves the logic into useCreateChatThreadItem, which now returns it as part of CreatedChatThreadItem.

Depends on D14137

Test Plan: I tested this task by playing around with the ChatThreadList on mobile while using a stopwatch to measure how long various operations took. I tested the updated code 3 times against both the most recent Testflight build as well as master. I found that performance was approximately the same as before. I tested scrolling down, selecting threads that were read, selecting threads that were unread, and search.

Reviewers: tomek, angelika

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D14138

Details

Provenance
ashoatAuthored on Fri, Nov 22, 4:29 PM
Reviewer
tomek
Differential Revision
D14138: [lib] Extract initialChatThreadItem
Parents
rCOMM9095f4869bfa: [lib] Avoid unnecessary useSelector on MessageStore in useGetLastUpdatedTimes
Branches
Unknown
Tags
Unknown