Skip to content

Commit

Permalink
Fix tracker crashes and update app version
Browse files Browse the repository at this point in the history
  • Loading branch information
rajarsheechatterjee committed Apr 30, 2021
1 parent 458cdb2 commit 1ed0e8b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "LNReader",
"slug": "LNReader",
"scheme": "lnreader",
"version": "1.0.14",
"version": "1.0.15",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
Expand Down
7 changes: 2 additions & 5 deletions src/redux/chapter/chapter.actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ export const getChapterAction = (
) => async (dispatch) => {
dispatch({ type: CHAPTER_LOADING });

const isDownloaded = await isChapterDownloaded(novelId);
let chapter;
let chapter = await getChapter(novelId);

if (isDownloaded) {
chapter = await getChapter(novelId);
} else {
if (!chapter) {
chapter = await fetchChapter(extensionId, novelUrl, chapterUrl);
}
console.log(isDownloaded);
Expand Down
4 changes: 2 additions & 2 deletions src/screens/More/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const AboutScreen = ({ navigation }) => {
<ListSection>
<ListItem
title="Version"
description="Stable 1.0.14"
description="Stable 1.0.15"
theme={theme}
/>
<ListItem
title="Build Time"
description="26-04-21 20:45 PM"
description="30-04-21 11:00 AM"
theme={theme}
/>
<ListItem
Expand Down
2 changes: 1 addition & 1 deletion src/screens/More/Trackers.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const TrackerScreen = ({ navigation }) => {
right={tracker && "check"}
theme={theme}
/>
{tracker.expires_in < new Date(Date.now()) && (
{tracker && tracker.expires_in < new Date(Date.now()) && (
<>
<Divider theme={theme} />
<ListSubHeader theme={theme}>
Expand Down
24 changes: 23 additions & 1 deletion src/screens/More/components/GridSizeModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import { Text, StyleSheet } from "react-native";
import { Portal, Modal } from "react-native-paper";
import Slider from "@react-native-community/slider";
import { RadioButton, RadioButtonGroup } from "../../../components/RadioButton";

const GridSizeModal = ({
itemsPerRow,
Expand All @@ -10,6 +11,14 @@ const GridSizeModal = ({
setItemsPerRow,
theme,
}) => {
const gridSizes = {
1: "XS",
2: "S",
3: "M",
4: "L",
5: "XL",
};

return (
<Portal>
<Modal
Expand Down Expand Up @@ -47,6 +56,19 @@ const GridSizeModal = ({
thumbTintColor={theme.colorAccentDark}
onValueChange={(value) => setItemsPerRow(value)}
/>
{/* <RadioButtonGroup
onValueChange={(value) => setItemsPerRow(value)}
value={itemsPerRow}
>
{Object.keys(gridSizes).map((item) => (
<RadioButton
key={item}
value={item}
label={gridSizes[item]}
theme={theme}
/>
))}
</RadioButtonGroup> */}
</Modal>
</Portal>
);
Expand All @@ -65,7 +87,7 @@ const styles = StyleSheet.create({
marginBottom: 10,
},
modalDescription: {
marginBottom: 4,
marginBottom: 16,
},
slider: {
width: "100%",
Expand Down
13 changes: 8 additions & 5 deletions src/screens/Novel/components/NovelHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const NovelInfoHeader = ({

const [downloadMenu, showDownloadMenu] = useState(false);

const tracker = useSelector((state) => state.trackerReducer.tracker);
const trackedNovels = useSelector(
(state) => state.trackerReducer.trackedNovels
);
Expand Down Expand Up @@ -109,11 +110,13 @@ const NovelInfoHeader = ({
followed={novel.followed}
novel={novel}
/>
<TrackerChip
theme={theme}
isTracked={isTracked}
trackerSheetRef={trackerSheetRef}
/>
{tracker && (
<TrackerChip
theme={theme}
isTracked={isTracked}
trackerSheetRef={trackerSheetRef}
/>
)}
<IconButton
onPress={() =>
WebBrowser.openBrowserAsync(novel.sourceUrl)
Expand Down
3 changes: 2 additions & 1 deletion src/screens/Novel/components/Tracker/TrackSearchDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ const TrackSearchDialog = ({
style={{ margin: 16 }}
/>
) : (
searchResults.data.length > 0 &&
searchResults &&
searchResults.data &&
searchResults.data.map((result) =>
renderSearchResultCard(result)
)
Expand Down
1 change: 1 addition & 0 deletions src/screens/Novel/components/Tracker/TrackSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const TrackSheet = ({ bottomSheetRef, novelId, novelName, theme }) => {
ref={bottomSheetRef}
draggableRange={{ top: 120, bottom: 0 }}
snappingPoints={[0, 120]}
backdropOpacity={0.25}
>
<View
style={[
Expand Down

0 comments on commit 1ed0e8b

Please sign in to comment.