mirror of https://github.com/readrops/Readrops.git
Select all option now respects the feed filter
This commit is contained in:
parent
245719e2f6
commit
aeb4994c2a
|
@ -40,6 +40,9 @@ public interface ItemDao {
|
|||
@Query("Update Item set read = :readState")
|
||||
void setAllItemsReadState(int readState);
|
||||
|
||||
@Query("Update Item set read = :readState Where feed_id = :feedId")
|
||||
void setAllItemsReadState(int feedId, int readState);
|
||||
|
||||
@Query("Update Item set read_it_later = 1 Where id = :itemId")
|
||||
void setReadItLater(int itemId);
|
||||
|
||||
|
|
|
@ -152,7 +152,10 @@ public class MainViewModel extends AndroidViewModel {
|
|||
|
||||
public Completable setAllItemsReadState(boolean read) {
|
||||
return Completable.create(emitter -> {
|
||||
db.itemDao().setAllItemsReadState(read ? 1 : 0);
|
||||
if (queryBuilder.getFilterType() == FilterType.FEED_FILTER)
|
||||
db.itemDao().setAllItemsReadState(queryBuilder.getFilterFeedId(), read ? 1 : 0);
|
||||
else
|
||||
db.itemDao().setAllItemsReadState(read ? 1 : 0);
|
||||
emitter.onComplete();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue