Use a post and handle-resolution cache to enable quick postthread loading (#1097)
* Use a post and handle-resolution cache to enable quick postthread loading * Fix positioning of thread when loaded from cache and give more visual cues * Include parent posts in cache * Include notifications in cache
This commit is contained in:
parent
7256169506
commit
a63f97aef2
9 changed files with 167 additions and 18 deletions
|
|
@ -503,7 +503,9 @@ export class NotificationsFeedModel {
|
|||
const postsRes = await this.rootStore.agent.app.bsky.feed.getPosts({
|
||||
uris: [addedUri],
|
||||
})
|
||||
notif.setAdditionalData(postsRes.data.posts[0])
|
||||
const post = postsRes.data.posts[0]
|
||||
notif.setAdditionalData(post)
|
||||
this.rootStore.posts.set(post.uri, post)
|
||||
}
|
||||
const filtered = this._filterNotifications([notif])
|
||||
return filtered[0]
|
||||
|
|
@ -611,6 +613,7 @@ export class NotificationsFeedModel {
|
|||
),
|
||||
)
|
||||
for (const post of postsChunks.flat()) {
|
||||
this.rootStore.posts.set(post.uri, post)
|
||||
const models = addedPostMap.get(post.uri)
|
||||
if (models?.length) {
|
||||
for (const model of models) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue