fix task list widget

This commit is contained in:
Phillip Thelen 2017-05-24 16:02:48 +02:00
parent 9babcac69a
commit 5eaea1a408
2 changed files with 6 additions and 3 deletions

View file

@ -26,7 +26,12 @@ public class RealmTaskLocalRepository extends RealmBaseLocalRepository implement
@Override
public Observable<RealmResults<Task>> getTasks(String taskType, String userID) {
return realm.where(Task.class).equalTo("type", taskType).equalTo("userId", userID).findAllSorted("position").sort("dateCreated", Sort.DESCENDING).asObservable()
return realm.where(Task.class)
.equalTo("type", taskType)
.equalTo("userId", userID)
.findAllSorted("position")
.sort("dateCreated", Sort.DESCENDING)
.asObservable()
.filter(RealmResults::isLoaded);
}

View file

@ -74,8 +74,6 @@ public abstract class TaskListFactory implements RemoteViewsService.RemoteViewsF
.flatMap(Observable::from)
.filter(task -> task.type.equals(Task.TYPE_TODO) || task.isDisplayedActive(customDayStart))
.toList()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(tasks -> {
taskList = tasks;
this.reloadData = false;