about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorarcalinea <arcalinea@users.noreply.github.com>2023-03-03 13:37:17 -0800
committerGitHub <noreply@github.com>2023-03-03 15:37:17 -0600
commitd74ff9c2199ed9487a90413d076459638b07c470 (patch)
tree4fcb0baa2735c3150486eb20ea137accb96e6ee8 /src
parent69d677427759e6eb5fd42f6b3afed3086f71031b (diff)
downloadvoidsky-d74ff9c2199ed9487a90413d076459638b07c470.tar.zst
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>
Diffstat (limited to 'src')
-rw-r--r--src/lib/constants.ts67
-rw-r--r--src/state/models/feed-view.ts8
-rw-r--r--src/view/com/posts/Feed.tsx4
3 files changed, 75 insertions, 4 deletions
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index a93301b34..31947cd8f 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -30,7 +30,68 @@ export function TEAM_HANDLES(serviceUrl: string) {
 }
 
 export const PROD_SUGGESTED_FOLLOWS = [
+  'christina',
+  'wesam',
+  'jim',
+  'ab',
+  'karalabe',
+  'clun',
+  'staltz',
+  'gillian',
+  'karpathy',
+  'zoink',
   'john',
+  'round',
+  'vex',
+  'umang',
+  'atroyn',
+  'poisonivy',
+  'wongmjane',
+  'lari',
+  'arunwadhwa',
+  'trav',
+  'fred',
+  'offscript',
+  'satnam',
+  'ella',
+  'caspian',
+  'spencer',
+  'nickgrossman',
+  'koji',
+  'avy',
+  'seymourstein',
+  'joelg',
+  'stig',
+  'rabble',
+  'hunterwalk',
+  'evan',
+  'aviral',
+  'tami',
+  'generativist',
+  'gord',
+  'ninjapleasedj',
+  'robotics',
+  'noahjnelson',
+  'vijay',
+  'scottbeale',
+  'daybreakjung',
+  'shelby',
+  'joel',
+  'space',
+  'rish',
+  'simon',
+  'kelly',
+  'maxbittker',
+  'sylphrenetic',
+  'caleb',
+  'jik',
+  'james',
+  'neil',
+  'tippenein',
+  'mandel',
+  'sharding',
+  'tyler',
+  'raymond',
   'visakanv',
   'saz',
   'steph',
@@ -39,12 +100,17 @@ export const PROD_SUGGESTED_FOLLOWS = [
   'weisser',
   'katherine',
   'annagat',
+  'an',
+  'kunal',
   'josh',
   'lurkshark',
   'amir',
   'amyxzh',
   'danielle',
   'jack-frazee',
+  'daniellefong',
+  'dystopiabreaker',
+  'morgan',
   'vibes',
   'cat',
   'yuriy',
@@ -63,6 +129,7 @@ export const PROD_SUGGESTED_FOLLOWS = [
   'jennijuju',
   'ian5v',
   'bnewbold',
+  'jasmine',
   'chris',
   'mtclai',
   'willscott',
diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts
index ed5a32d8f..fe0943018 100644
--- a/src/state/models/feed-view.ts
+++ b/src/state/models/feed-view.ts
@@ -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,
         )
diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx
index a4963e0d6..7ed6bc711 100644
--- a/src/view/com/posts/Feed.tsx
+++ b/src/view/com/posts/Feed.tsx
@@ -78,11 +78,11 @@ export const Feed = observer(function Feed({
   // =
 
   const checkWelcome = React.useCallback(async () => {
-    if (showWelcomeBanner) {
+    if (showWelcomeBanner && store.me.did) {
       await store.me.follows.fetchIfNeeded()
       setIsNewUser(store.me.follows.isEmpty)
     }
-  }, [showWelcomeBanner, store.me.follows])
+  }, [showWelcomeBanner, store.me.follows, store.me.did])
   React.useEffect(() => {
     checkWelcome()
   }, [checkWelcome])