Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'main' of github.com:bluesky-social/social-app into main

+21 -3
+9
src/state/models/me.ts
··· 6 6 import {RootStoreModel} from './root-store' 7 7 import {PostsFeedModel} from './feeds/posts' 8 8 import {NotificationsFeedModel} from './feeds/notifications' 9 + import {MyFeedsUIModel} from './ui/my-feeds' 9 10 import {MyFollowsCache} from './cache/my-follows' 10 11 import {isObj, hasProp} from 'lib/type-guards' 11 12 ··· 22 23 followersCount: number | undefined 23 24 mainFeed: PostsFeedModel 24 25 notifications: NotificationsFeedModel 26 + myFeeds: MyFeedsUIModel 25 27 follows: MyFollowsCache 26 28 invites: ComAtprotoServerDefs.InviteCode[] = [] 27 29 appPasswords: ComAtprotoServerListAppPasswords.AppPassword[] = [] ··· 42 44 algorithm: 'reverse-chronological', 43 45 }) 44 46 this.notifications = new NotificationsFeedModel(this.rootStore) 47 + this.myFeeds = new MyFeedsUIModel(this.rootStore) 45 48 this.follows = new MyFollowsCache(this.rootStore) 46 49 } 47 50 48 51 clear() { 49 52 this.mainFeed.clear() 50 53 this.notifications.clear() 54 + this.myFeeds.clear() 51 55 this.follows.clear() 52 56 this.rootStore.profiles.cache.clear() 53 57 this.rootStore.posts.cache.clear() ··· 111 115 /* dont await */ this.notifications.setup().catch(e => { 112 116 this.rootStore.log.error('Failed to setup notifications model', e) 113 117 }) 118 + /* dont await */ this.notifications.setup().catch(e => { 119 + this.rootStore.log.error('Failed to setup notifications model', e) 120 + }) 121 + this.myFeeds.clear() 122 + /* dont await */ this.myFeeds.saved.refresh() 114 123 this.rootStore.emitSessionLoaded() 115 124 await this.fetchInviteCodes() 116 125 await this.fetchAppPasswords()
+6 -1
src/state/models/ui/my-feeds.ts
··· 77 77 } 78 78 } 79 79 80 + clear() { 81 + this.saved.clear() 82 + this.discovery.clear() 83 + } 84 + 80 85 registerListeners() { 81 86 const dispose1 = reaction( 82 87 () => this.rootStore.preferences.savedFeeds, ··· 107 112 _reactKey: '__saved_feeds_header__', 108 113 type: 'saved-feeds-header', 109 114 }) 110 - if (this.saved.isLoading) { 115 + if (this.saved.isLoading && !this.saved.hasContent) { 111 116 items.push({ 112 117 _reactKey: '__saved_feeds_loading__', 113 118 type: 'saved-feeds-loading',
+4
src/state/models/ui/saved-feeds.ts
··· 52 52 // public api 53 53 // = 54 54 55 + clear() { 56 + this.all = [] 57 + } 58 + 55 59 /** 56 60 * Refresh the preferences then reload all feed infos 57 61 */
+2 -2
src/view/screens/Feeds.tsx
··· 22 22 import {ErrorMessage} from 'view/com/util/error/ErrorMessage' 23 23 import debounce from 'lodash.debounce' 24 24 import {Text} from 'view/com/util/text/Text' 25 - import {MyFeedsUIModel, MyFeedsItem} from 'state/models/ui/my-feeds' 25 + import {MyFeedsItem} from 'state/models/ui/my-feeds' 26 26 import {FeedSourceModel} from 'state/models/content/feed-source' 27 27 import {FlatList} from 'view/com/util/Views' 28 28 import {useFocusEffect} from '@react-navigation/native' ··· 34 34 const pal = usePalette('default') 35 35 const store = useStores() 36 36 const {isMobile, isTabletOrDesktop} = useWebMediaQueries() 37 - const myFeeds = React.useMemo(() => new MyFeedsUIModel(store), [store]) 37 + const myFeeds = store.me.myFeeds 38 38 const [query, setQuery] = React.useState<string>('') 39 39 const debouncedSearchFeeds = React.useMemo( 40 40 () => debounce(q => myFeeds.discovery.search(q), 500), // debounce for 500ms