Page MenuHomePhabricator

[lib] Extract initialChatThreadItem
ClosedPublic

Authored by ashoat on Dec 11 2024, 3:46 PM.
Tags
None
Referenced Files
F6090413: D14138.id.diff
Mon, Apr 21, 1:28 AM
F6082277: D14138.id46357.diff
Sun, Apr 20, 10:04 PM
F6045158: D14138.diff
Sun, Apr 20, 4:01 AM
Unknown Object (File)
Mar 11 2025, 3:58 PM
Unknown Object (File)
Feb 26 2025, 4:45 AM
Unknown Object (File)
Feb 26 2025, 4:45 AM
Unknown Object (File)
Feb 26 2025, 4:44 AM
Unknown Object (File)
Feb 25 2025, 4:29 AM
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