diff --git a/src/components/ChapterBottomSheet.js b/src/components/ChapterBottomSheet.js index 4b20ea14..72e35c11 100644 --- a/src/components/ChapterBottomSheet.js +++ b/src/components/ChapterBottomSheet.js @@ -24,7 +24,7 @@ const ChapterBottomSheet = ({ style={[ styles.contentContainer, { - backgroundColor: "rgba(0,0,0,0.5)", + backgroundColor: "rgba(0,0,0,0.4)", }, ]} > diff --git a/src/components/ChapterCard.js b/src/components/ChapterCard.js index 1eb9093e..f33b76c2 100644 --- a/src/components/ChapterCard.js +++ b/src/components/ChapterCard.js @@ -12,7 +12,7 @@ const ChapterCard = ({ }) => ( { return ( - @@ -253,24 +252,26 @@ const ChapterItem = ({ route, navigation }) => { /> ) : ( - - {chapter.chapterText.trim()} - + <> + + {chapter.chapterText.trim()} + + )} { ) .then((response) => response.json()) .then((json) => { - insertIntoDb( - { - novelSummary: json.novelSummary, - "Author(s)": json["Author(s)"], - "Genre(s)": json["Genre(s)"], - Status: json.Status, - sourceUrl: json.sourceUrl, - source: json.sourceName, - }, - json.novelChapters - ); - checkIfExistsInDb(); + let novelObj = { + novelSummary: json.novelSummary, + "Author(s)": json["Author(s)"], + "Genre(s)": json["Genre(s)"], + Status: json.Status, + sourceUrl: json.sourceUrl, + source: json.sourceName, + unread: 1, + lastRead: json.novelChapters[0].chapterUrl, + lastReadName: json.novelChapters[0].chapterName, + }; + setNovel(novelObj); + setChapters(json.novelChapters); + setLoading(false); + setRefreshing(false); + insertIntoDb(novelObj, json.novelChapters); console.log("Setdb"); }) .catch((error) => console.error(error)); @@ -92,8 +96,8 @@ const NovelItem = ({ route, navigation }) => { nov["Genre(s)"], nov.Status, extensionId, - chaps[0].chapterUrl, - chaps[0].chapterName, + nov.lastRead, + nov.lastReadName, nov.sourceUrl, nov.source, ], @@ -103,6 +107,8 @@ const NovelItem = ({ route, navigation }) => { (txObj, error) => console.log("Error ", error) ); + // console.log(chaps[0]); + // Insert chapters into database chaps.map((chap) => tx.executeSql(