[Session] Drill into getAgent into whenAppViewReady (#3702)

* Drill into whenAppViewReady

(cherry picked from commit e290e5be3df509bdd9d0e626a164996c9dee3636)

* Drill getAgent instead

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
Eric Bailey 2024-04-25 15:39:28 -05:00 committed by GitHub
parent ec37696034
commit a69e567991
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 45 additions and 20 deletions

View file

@ -8,6 +8,7 @@ import {
AppBskyEmbedRecordWithMedia,
AppBskyFeedDefs,
AtUri,
BskyAgent,
} from '@atproto/api'
import {
QueryClient,
@ -154,6 +155,7 @@ export function useProfileUpdateMutation() {
return existing
})
await whenAppViewReady(
getAgent,
profile.did,
checkCommitted ||
(res => {
@ -516,6 +518,7 @@ export function precacheThreadPostProfiles(
}
async function whenAppViewReady(
getAgent: () => BskyAgent,
actor: string,
fn: (res: AppBskyActorGetProfile.Response) => boolean,
) {