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:
parent
3791b4821b
commit
eb19c3a642
@ -339,8 +339,6 @@ class HomeFragment : Fragment() {
|
||||
}
|
||||
|
||||
requireComponents.core.sessionStorage.remove(archivedSession.bundle)
|
||||
|
||||
true
|
||||
}
|
||||
}.show(requireActivity().supportFragmentManager, SessionBottomSheetFragment.overflowFragmentTag)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user