Skip to content

Commit

Permalink
Reset Progress on Chapter End (Closes #791)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajarsheechatterjee committed Jan 7, 2024
1 parent e4ca751 commit 2c1cce7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/screens/reader/ReaderScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ const ChapterContent = ({ route, navigation }) => {
}
}, []);

useEffect(() => {
return () => {
if (position?.percentage === 100) {
doSaveProgress(0, 0);
}
};
}, [position?.percentage]);

const scrollToSavedProgress = useCallback(
() => scrollTo(position?.position),
[],
Expand Down

0 comments on commit 2c1cce7

Please sign in to comment.