Commit e1f3611f authored by ValentinTimisica's avatar ValentinTimisica Committed by Emily Kager
Browse files

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.
parent 40047315
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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?) {