2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/673 - Dismiss bottom sheet on archive. Remove boolean logic

This commit is contained in:
Jeff Boek 2019-03-01 00:06:40 -08:00 committed by Colin Lee
parent 3791b4821b
commit eb19c3a642
2 changed files with 4 additions and 6 deletions

View File

@ -339,8 +339,6 @@ class HomeFragment : Fragment() {
}
requireComponents.core.sessionStorage.remove(archivedSession.bundle)
true
}
}.show(requireActivity().supportFragmentManager, SessionBottomSheetFragment.overflowFragmentTag)
}

View File

@ -19,7 +19,7 @@ class SessionBottomSheetFragment : BottomSheetDialogFragment(), LayoutContainer
var archivedSession: ArchivedSession? = null
var isCurrentSession: Boolean = false
private lateinit var tabTitles: String
var onDelete: ((ArchivedSession) -> Boolean)? = null
var onDelete: ((ArchivedSession) -> Unit)? = null
var onArchive: (() -> Unit)? = null
override val containerView: View?
@ -51,14 +51,14 @@ class SessionBottomSheetFragment : BottomSheetDialogFragment(), LayoutContainer
visibility = if (isCurrentSession) View.VISIBLE else View.GONE
setOnClickListener {
onArchive?.invoke()
dismiss()
}
}
view.delete_session_button.setOnClickListener {
if (onDelete?.invoke(archivedSession!!) == true) {
onDelete?.invoke(archivedSession!!)
dismiss()
}
}
return view
}