fix minor issues

This commit is contained in:
Phillip Thelen 2017-06-23 11:47:55 +02:00
parent 45ee45ff17
commit f7dc8f936b
5 changed files with 6 additions and 9 deletions

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.habitrpg.android.habitica"
android:versionCode="1894"
android:versionCode="1896"
android:versionName="1.1"
android:screenOrientation="portrait"
android:installLocation="auto" >

View file

@ -6,7 +6,7 @@
<string name="SP_APIToken" translatable="false">APIToken</string>
<string name="SP_username" translatable="false">Username</string>
<string name="SP_email" translatable="false">E-mail</string>
<string name="base_url" translatable="false">https://habitica.com</string>
<string name="base_url" translatable="false">https://habitrpg-beta.herokuapp.com</string>
<!-- Local notification actions -->
<string name="accept_party_invite" translatable="false">ACCEPT_PARTY_INVITE</string>

View file

@ -55,7 +55,7 @@ public class TaskRepositoryImpl extends BaseRepositoryImpl<TaskLocalRepository>
@Override
public Observable<TaskScoringResult> taskChecked(@Nullable User user, Task task, boolean up, boolean force) {
long now = new Date().getTime();
if (lastTaskAction > now-500 || force) {
if (lastTaskAction > now-500 && !force) {
return Observable.just(null);
}
lastTaskAction = now;

View file

@ -458,7 +458,7 @@ public class User extends RealmObject {
return party != null && party.id != null && party.id.length() > 0;
}
public boolean getNeedsCron() {
public Boolean getNeedsCron() {
return needsCron;
}

View file

@ -3,7 +3,6 @@ package com.habitrpg.android.habitica.ui.views.yesterdailies;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
@ -24,7 +23,6 @@ import java.util.List;
import butterknife.BindColor;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.realm.RealmResults;
public class YesterdailyDialog extends AlertDialog {
@ -103,9 +101,8 @@ public class YesterdailyDialog extends AlertDialog {
public static void showDialogIfNeeded(Activity activity, String userId, UserRepository userRepository, TaskRepository taskRepository) {
if (userRepository != null && userId != null) {
userRepository.getUser(userId).first()
.filter(User::getNeedsCron)
.flatMap(user -> taskRepository.getTasks(Task.TYPE_DAILY, userId))
.first()
.filter(user -> user != null && user.getNeedsCron() != null && user.getNeedsCron())
.flatMap(user -> taskRepository.getTasks(Task.TYPE_DAILY, userId).first())
.map(tasks -> tasks.where().equalTo("isDue", true).equalTo("completed", false).equalTo("yesterDaily", true).findAll())
.flatMap(taskRepository::getTaskCopies)
.subscribe(tasks -> {