Improve typeahead search with inclusion of followed users (temporary solution) (#1612)
* Update follows cache to maintain some user info * Prioritize follows in composer autocomplete * Clean up logic and add new autocomplete to search * Update follow hook
This commit is contained in:
parent
19f8389fc7
commit
bd7db8af26
20 changed files with 197 additions and 142 deletions
|
|
@ -126,7 +126,7 @@ export class LikesModel {
|
|||
_appendAll(res: GetLikes.Response) {
|
||||
this.loadMoreCursor = res.data.cursor
|
||||
this.hasMore = !!this.loadMoreCursor
|
||||
this.rootStore.me.follows.hydrateProfiles(
|
||||
this.rootStore.me.follows.hydrateMany(
|
||||
res.data.likes.map(like => like.actor),
|
||||
)
|
||||
this.likes = this.likes.concat(res.data.likes)
|
||||
|
|
|
|||
|
|
@ -130,6 +130,6 @@ export class RepostedByModel {
|
|||
this.loadMoreCursor = res.data.cursor
|
||||
this.hasMore = !!this.loadMoreCursor
|
||||
this.repostedBy = this.repostedBy.concat(res.data.repostedBy)
|
||||
this.rootStore.me.follows.hydrateProfiles(res.data.repostedBy)
|
||||
this.rootStore.me.follows.hydrateMany(res.data.repostedBy)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,6 @@ export class UserFollowersModel {
|
|||
this.loadMoreCursor = res.data.cursor
|
||||
this.hasMore = !!this.loadMoreCursor
|
||||
this.followers = this.followers.concat(res.data.followers)
|
||||
this.rootStore.me.follows.hydrateProfiles(res.data.followers)
|
||||
this.rootStore.me.follows.hydrateMany(res.data.followers)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,6 @@ export class UserFollowsModel {
|
|||
this.loadMoreCursor = res.data.cursor
|
||||
this.hasMore = !!this.loadMoreCursor
|
||||
this.follows = this.follows.concat(res.data.follows)
|
||||
this.rootStore.me.follows.hydrateProfiles(res.data.follows)
|
||||
this.rootStore.me.follows.hydrateMany(res.data.follows)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue