From b97b9d5ef4e2becf679d0d1e322fa875d72ae828 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Mon, 17 Aug 2020 15:33:47 -0500 Subject: [PATCH] Fix rotation while editing task --- .../main/java/com/todoroo/astrid/activity/MainActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/todoroo/astrid/activity/MainActivity.kt b/app/src/main/java/com/todoroo/astrid/activity/MainActivity.kt index 3df509ef4..06f02a158 100644 --- a/app/src/main/java/com/todoroo/astrid/activity/MainActivity.kt +++ b/app/src/main/java/com/todoroo/astrid/activity/MainActivity.kt @@ -180,6 +180,7 @@ class MainActivity : InjectingAppCompatActivity(), TaskListFragmentCallbackHandl val loadFilter = intent.getFilterString val openTask = !intent.isFromHistory && (intent.hasExtra(OPEN_TASK) || intent.hasExtra(CREATE_TASK)) + val tef = taskEditFragment Timber.d(""" ********** @@ -194,7 +195,7 @@ class MainActivity : InjectingAppCompatActivity(), TaskListFragmentCallbackHandl taskEditFragment: ${taskEditFragment?.editViewModel?.task} **********""") if (!openTask && (openFilter != null || !loadFilter.isNullOrBlank())) { - taskEditFragment?.let { + tef?.let { lifecycleScope.launch { it.save() } @@ -241,8 +242,7 @@ class MainActivity : InjectingAppCompatActivity(), TaskListFragmentCallbackHandl existing } if (isSinglePaneLayout) { - if (openTask) { - setFilter(null) + if (openTask || tef != null) { openTask(null) } else { openTaskListFragment(filter, false)