mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-08-01 03:30:34 +00:00
fix minor errors
This commit is contained in:
parent
12325641cc
commit
ac2bfaf7b3
6 changed files with 7 additions and 7 deletions
|
|
@ -2,8 +2,8 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.habitrpg.android.habitica"
|
||||
android:versionCode="1940"
|
||||
android:versionName="1.2.1"
|
||||
android:versionCode="1943"
|
||||
android:versionName="1.2.2"
|
||||
android:screenOrientation="portrait"
|
||||
android:installLocation="auto" >
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class TaskRepositoryImpl extends BaseRepositoryImpl<TaskLocalRepository>
|
|||
|
||||
@Override
|
||||
public Observable<TaskScoringResult> taskChecked(User user, String taskId, boolean up, boolean force) {
|
||||
return localRepository.getTask(taskId)
|
||||
return localRepository.getTask(taskId).first()
|
||||
.flatMap(task -> taskChecked(user, task, up, force));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1285,7 +1285,7 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
|
|||
this.task.setType(taskType);
|
||||
}
|
||||
|
||||
if (this.saveTask(this.task)) {
|
||||
if (this.saveTask(this.task) && task.isValid()) {
|
||||
//send back to other elements.
|
||||
if (TaskFormActivity.this.task.getId() == null) {
|
||||
taskRepository.createTaskInBackground(task);
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ public abstract class BaseMainFragment extends BaseFragment {
|
|||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
if (user != null) {
|
||||
if (user != null && user.isValid()) {
|
||||
outState.putString("userId", user.getId());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class HabitButtonWidgetProvider extends BaseWidgetProvider {
|
|||
int[] ids = {appWidgetId};
|
||||
|
||||
if (taskId != null) {
|
||||
userRepository.getUser(userId).flatMap(user -> taskRepository.taskChecked(user, taskId, TaskDirection.up.toString().equals(direction), false))
|
||||
userRepository.getUser(userId).first().flatMap(user -> taskRepository.taskChecked(user, taskId, TaskDirection.up.toString().equals(direction), false))
|
||||
.subscribe(taskDirectionData -> {
|
||||
showToastForTaskDirection(context, taskDirectionData, userId);
|
||||
}, RxErrorHandler.handleEmptyError(), () -> this.onUpdate(context, mgr, ids));
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public abstract class TaskListWidgetProvider extends BaseWidgetProvider {
|
|||
String taskId = intent.getStringExtra(TASK_ID_ITEM);
|
||||
|
||||
if (taskId != null) {
|
||||
userRepository.getUser(userId).flatMap(user -> taskRepository.taskChecked(user, taskId, true, false))
|
||||
userRepository.getUser(userId).first().flatMap(user -> taskRepository.taskChecked(user, taskId, true, false))
|
||||
.subscribe(taskDirectionData -> {
|
||||
taskRepository.markTaskCompleted(taskId, true);
|
||||
showToastForTaskDirection(context, taskDirectionData, userId);
|
||||
|
|
|
|||
Loading…
Reference in a new issue