diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 10:46:12 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 10:46:12 -0600 |
commit | fb3a43c216a884f7185c53cba6e210d6659448d1 (patch) | |
tree | 171877b22ccd90087b894df8003ed42ebf689601 /src/view/com/notifications/Feed.tsx | |
parent | 6e93301542ce9593f614ab89883e3c87e38c5769 (diff) | |
download | voidsky-fb3a43c216a884f7185c53cba6e210d6659448d1.tar.zst |
Improve error messages
Diffstat (limited to 'src/view/com/notifications/Feed.tsx')
-rw-r--r-- | src/view/com/notifications/Feed.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/view/com/notifications/Feed.tsx b/src/view/com/notifications/Feed.tsx index a3cac0cdf..2b7bb878f 100644 --- a/src/view/com/notifications/Feed.tsx +++ b/src/view/com/notifications/Feed.tsx @@ -6,11 +6,14 @@ import { NotificationsViewItemModel, } from '../../../state/models/notifications-view' import {FeedItem} from './FeedItem' +import {ErrorMessage} from '../util/ErrorMessage' export const Feed = observer(function Feed({ view, + onPressTryAgain, }: { view: NotificationsViewModel + onPressTryAgain?: () => void }) { // TODO optimize renderItem or FeedItem, we're getting this notice from RN: -prf // VirtualizedList: You have a large list that is slow to update - make sure your @@ -30,7 +33,14 @@ export const Feed = observer(function Feed({ {view.isLoading && !view.isRefreshing && !view.hasContent && ( <Text>Loading...</Text> )} - {view.hasError && <Text>{view.error}</Text>} + {view.hasError && ( + <ErrorMessage + dark + message={view.error} + style={{margin: 6}} + onPressTryAgain={onPressTryAgain} + /> + )} {view.hasContent && ( <FlatList data={view.notifications} |