Skip to content

Commit

Permalink
Add Exclude Downloads Filter (Closes #848)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajarsheechatterjee committed Jan 4, 2024
1 parent 60cf358 commit a298ed8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/screens/novel/components/NovelBottomSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,24 @@ const ChaptersSettingsSheet = ({
theme={theme}
label="Downloaded"
color={theme.primary}
status={filter.match('AND downloaded=1')}
onPress={() =>
status={
filter.match('AND downloaded=1')
? filterChapters(filter.replace(' AND downloaded=1', ''))
: filterChapters(filter + ' AND downloaded=1')
? true
: filter.match('AND downloaded=0')
? 'indeterminate'
: false
}
onPress={() => {
if (filter.match('AND downloaded=0')) {
filterChapters(
filter.replace(' AND downloaded=0', ' AND downloaded=1'),
);
} else if (filter.match('AND downloaded=1')) {
filterChapters(filter.replace(' AND downloaded=1', ''));
} else {
filterChapters(filter + ' AND downloaded=0');
}
}}
/>
<Checkbox
theme={theme}
Expand Down

0 comments on commit a298ed8

Please sign in to comment.