diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-05-25 20:49:16 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-05-25 20:49:16 -0500 |
commit | 11262ffc83be69f149c2a5fe176fcb8a8588c014 (patch) | |
tree | 882ab10c59d86e531f11399c8f309ee9a1149bb1 /src | |
parent | 229153a26c448aa8dd97775c42166e36d6051985 (diff) | |
parent | fa9b91f7937b4e491adf4b2abc29c3b7fa8ac8bd (diff) | |
download | voidsky-11262ffc83be69f149c2a5fe176fcb8a8588c014.tar.zst |
Merge branch 'custom-algos' of github.com:bluesky-social/social-app into custom-algos
Diffstat (limited to 'src')
-rw-r--r-- | src/state/models/feeds/custom-feed.ts | 8 | ||||
-rw-r--r-- | src/view/screens/CustomFeed.tsx | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/state/models/feeds/custom-feed.ts b/src/state/models/feeds/custom-feed.ts index 9ac69ac28..8fc1eb1ec 100644 --- a/src/state/models/feeds/custom-feed.ts +++ b/src/state/models/feeds/custom-feed.ts @@ -8,13 +8,19 @@ export class CustomFeedModel { // data _reactKey: string data: AppBskyFeedDefs.GeneratorView + isOnline: boolean + isValid: boolean constructor( public rootStore: RootStoreModel, view: AppBskyFeedDefs.GeneratorView, + isOnline?: boolean, + isValid?: boolean, ) { this._reactKey = view.uri this.data = view + this.isOnline = isOnline ?? true + this.isValid = isValid ?? true makeAutoObservable( this, { @@ -103,6 +109,8 @@ export class CustomFeedModel { }) runInAction(() => { this.data = res.data.view + this.isOnline = res.data.isOnline + this.isValid = res.data.isValid }) } diff --git a/src/view/screens/CustomFeed.tsx b/src/view/screens/CustomFeed.tsx index 79b10de04..4149cd49d 100644 --- a/src/view/screens/CustomFeed.tsx +++ b/src/view/screens/CustomFeed.tsx @@ -30,6 +30,7 @@ import {FAB} from '../com/util/fab/FAB' import {LoadLatestBtn} from 'view/com/util/load-latest/LoadLatestBtn' import {DropdownButton, DropdownItem} from 'view/com/util/forms/DropdownButton' import {useOnMainScroll} from 'lib/hooks/useOnMainScroll' +import {EmptyState} from 'view/com/util/EmptyState' type Props = NativeStackScreenProps<CommonNavigatorParams, 'CustomFeed'> export const CustomFeedScreen = withAuthRequired( @@ -326,6 +327,10 @@ export const CustomFeedScreen = withAuthRequired( onTogglePinned, ]) + const renderEmptyState = React.useCallback(() => { + return <EmptyState icon="feed" message="This list is empty!" /> + }, []) + return ( <View style={s.hContentRegion}> <ViewHeader title="" renderButton={currentFeed && renderHeaderBtns} /> @@ -335,6 +340,7 @@ export const CustomFeedScreen = withAuthRequired( onScroll={onMainScroll} scrollEventThrottle={100} ListHeaderComponent={renderListHeaderComponent} + renderEmptyState={renderEmptyState} extraData={[uri, isPinned]} /> {isScrolledDown ? ( |