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:
parent
da8af38dcc
commit
1b356556c9
6 changed files with 97 additions and 81 deletions
|
@ -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} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue