1
0
Fork 0

Fixes #6408: Pop stack to homeFragment when opening bookmarks from homeFragment

When bookmark fragment is opened from homeFragment, libraryFragment does not
exists so the popBackStack(R.id.libraryFragment, true) would have failed. So
the solution for this was to pop back stack to homeFragment when the
bookmarks/history fragments are opened from homeFragment.
master
ValentinTimisica 2019-11-07 12:42:23 +02:00 committed by Emily Kager
parent 40047315c2
commit e1f3611fdd
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@ abstract class LibraryPageFragment<T> : Fragment() {
abstract val selectedItems: Set<T>
protected fun close() {
findNavController().popBackStack(R.id.libraryFragment, true)
if (!findNavController().popBackStack(R.id.libraryFragment, true)) {
findNavController().popBackStack(R.id.homeFragment, false)
}
}
protected fun openItemsInNewTab(private: Boolean = false, toUrl: (T) -> String?) {