Page MenuHomePhabricator

[lib] Extract initialChatThreadItem
ClosedPublic

Authored by ashoat on Wed, Dec 11, 3:46 PM.
Tags
None
Referenced Files
F3513875: D14138.diff
Sun, Dec 22, 2:31 AM
F3512341: D14138.id46359.diff
Sat, Dec 21, 7:24 PM
F3510881: D14138.id46440.diff
Sat, Dec 21, 12:14 PM
Unknown Object (File)
Fri, Dec 20, 9:30 PM
Unknown Object (File)
Fri, Dec 20, 4:37 AM
Unknown Object (File)
Thu, Dec 19, 11:28 PM
Unknown Object (File)
Thu, Dec 19, 2:26 PM
Unknown Object (File)
Thu, Dec 19, 12:51 PM
Subscribers
None

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable