diff --git a/src/screens/updates/UpdatesScreen.js b/src/screens/updates/UpdatesScreen.js index 58181534..08a9c9b8 100644 --- a/src/screens/updates/UpdatesScreen.js +++ b/src/screens/updates/UpdatesScreen.js @@ -24,6 +24,7 @@ import { deleteChapterAction, downloadChapterAction, } from '../../redux/novel/novel.actions'; +import {showToast} from '../../hooks/showToast'; const Updates = ({navigation}) => { const theme = useTheme(); @@ -40,6 +41,14 @@ const Updates = ({navigation}) => { const [searchResults, setSearchResults] = useState([]); const [refreshing, setRefreshing] = useState(false); + let sectionedUpdates = []; + + if (updates.length && updates[0].data !== undefined) { + sectionedUpdates = updates; + } else { + showToast('Update your library to show updates.'); + } + useFocusEffect( useCallback(() => { dispatch(getUpdatesAction()); @@ -168,7 +177,7 @@ const Updates = ({navigation}) => { )} index.toString()} renderItem={renderItem} renderSectionHeader={({section: {date}}) => (