New user constants (#260)

* update users

* update

* With constructed intro feed, only grab 20 random suggested users to avoid perf issues

* Don't 'check for latest' in the feed with the suggestions feed

* Show/hide the welcome banner on account change (close #257)

---------

Co-authored-by: Jay Graber <arcalinea@gmail.com>
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
arcalinea 2023-03-03 13:37:17 -08:00 committed by GitHub
parent 69d6774277
commit d74ff9c219
5 changed files with 89 additions and 4 deletions

View file

@ -7,6 +7,7 @@ import {
} from '@atproto/api'
import AwaitLock from 'await-lock'
import {bundleAsync} from 'lib/async/bundle'
import sampleSize from 'lodash.samplesize'
type FeedViewPost = AppBskyFeedFeedViewPost.Main
type ReasonRepost = AppBskyFeedFeedViewPost.ReasonRepost
type PostView = AppBskyFeedPost.View
@ -425,7 +426,7 @@ export class FeedModel {
* Check if new posts are available
*/
async checkForLatest() {
if (this.hasNewLatest) {
if (this.hasNewLatest || this.rootStore.me.follows.isEmpty) {
return
}
const res = await this._getFeed({limit: 1})
@ -565,7 +566,10 @@ export class FeedModel {
if (this.rootStore.me.follows.isEmpty) {
const responses = await getMultipleAuthorsPosts(
this.rootStore,
SUGGESTED_FOLLOWS(String(this.rootStore.agent.service)),
sampleSize(
SUGGESTED_FOLLOWS(String(this.rootStore.agent.service)),
20,
),
params.before,
20,
)