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.
staging
ValentinTimisica 5 years ago committed by Emily Kager
parent 40047315c2
commit e1f3611fdd

@ -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?) {

Loading…
Cancel
Save