Performance fixes with new getPosts (#525)

* Update notifications to fetch in a batch using getPosts

* Improve search perf with getPosts

* Bump @atproto/api@0.2.9

* Just use post uri for key
This commit is contained in:
Paul Frazee 2023-04-24 17:02:58 -05:00 committed by GitHub
parent da8af38dcc
commit 1b356556c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 97 additions and 81 deletions

View file

@ -49,7 +49,7 @@ const PostResults = observer(({model}: {model: SearchUIModel}) => {
)
}
if (model.postUris.length === 0) {
if (model.posts.length === 0) {
return (
<CenteredView>
<Text type="xl" style={[styles.empty, pal.text]}>
@ -61,8 +61,13 @@ const PostResults = observer(({model}: {model: SearchUIModel}) => {
return (
<ScrollView style={pal.view}>
{model.postUris.map(uri => (
<Post key={uri} uri={uri} hideError />
{model.posts.map(post => (
<Post
key={post.resolvedUri}
uri={post.resolvedUri}
initView={post}
hideError
/>
))}
<View style={s.footerSpacer} />
<View style={s.footerSpacer} />