diff --git a/src/screens/novel/components/DownloadCustomChapterModal.js b/src/screens/novel/components/DownloadCustomChapterModal.js index 4a02682d..aa3f34ad 100644 --- a/src/screens/novel/components/DownloadCustomChapterModal.js +++ b/src/screens/novel/components/DownloadCustomChapterModal.js @@ -16,7 +16,7 @@ const DownloadCustomChapterModal = ({ const onDismiss = () => { hideModal(); - setText(); + setText(0); }; const onSubmit = () => { @@ -29,13 +29,17 @@ const DownloadCustomChapterModal = ({ chapter => !!chapter.read === false && !!chapter.downloaded === false, ) - .slice(0, text), + .slice(0, text.toString()), ), ); hideModal(); }; - const onChangeText = txt => setText(parseInt(txt, 10)); + const onChangeText = txt => { + if (Number(txt) >= 0) { + setText(Number(txt)); + } + }; return ( @@ -56,15 +60,17 @@ const DownloadCustomChapterModal = ({ animated size={24} color={theme.colorAccent} + onPress={() => text > 9 && setText(prevState => prevState - 10)} /> text > 0 && setText(prevState => prevState - 1)} /> setText(prevState => prevState + 1)} /> setText(prevState => prevState + 10)} />