Skip to content

Commit

Permalink
fix edit history selection was never cleared (fixes #5600)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Apr 28, 2024
1 parent 1dcfd10 commit e2d1e15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,7 @@ class MainFragment :
if (editHistoryFragment != null) {
childFragmentManager.popBackStack(EDIT_HISTORY, FragmentManager.POP_BACK_STACK_INCLUSIVE)
}
clearHighlighting()
mapFragment?.clearFocus()
editHistoryViewModel.select(null)
mapFragment?.pinMode = MainMapFragment.PinMode.QUESTS
historyBackPressedCallback.isEnabled = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class EditHistoryViewModelImpl(
} ?: ElementPointGeometry(edit.position)

override fun select(editKey: EditKey?) {
selectedEdit.value = edits.value.firstOrNull { it.key == editKey }
selectedEdit.value =
if (editKey != null) edits.value.firstOrNull { it.key == editKey }

Check failure on line 90 in app/src/main/java/de/westnordost/streetcomplete/screens/main/edithistory/EditHistoryViewModel.kt

View workflow job for this annotation

GitHub Actions / Kotlin

Expected a newline

Check failure on line 90 in app/src/main/java/de/westnordost/streetcomplete/screens/main/edithistory/EditHistoryViewModel.kt

View workflow job for this annotation

GitHub Actions / Kotlin

Missing { ... }
else null

Check failure on line 91 in app/src/main/java/de/westnordost/streetcomplete/screens/main/edithistory/EditHistoryViewModel.kt

View workflow job for this annotation

GitHub Actions / Kotlin

Expected a newline

Check failure on line 91 in app/src/main/java/de/westnordost/streetcomplete/screens/main/edithistory/EditHistoryViewModel.kt

View workflow job for this annotation

GitHub Actions / Kotlin

Missing { ... }
}

override fun undo(edit: Edit) {
Expand Down

0 comments on commit e2d1e15

Please sign in to comment.