2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00

[fenix] Fixes https://github.com/mozilla-mobile/fenix/issues/741 - Dont show the current session in the previous session list

This commit is contained in:
Jeff Boek 2019-02-28 12:39:18 -08:00 committed by Colin Lee
parent 48c455f4c0
commit f3e8316105

View File

@ -95,11 +95,13 @@ class HomeFragment : Fragment() {
val bundles = requireComponents.core.sessionStorage.bundles(temporaryNumberOfSessions)
bundles.observe(this, Observer { sessionBundles ->
val archivedSessions = sessionBundles.mapNotNull { sessionBundle ->
sessionBundle.id?.let {
ArchivedSession(it, sessionBundle, sessionBundle.lastSavedAt, sessionBundle.urls)
val archivedSessions = sessionBundles
.filter { it.id != requireComponents.core.sessionStorage.current()?.id }
.mapNotNull { sessionBundle ->
sessionBundle.id?.let {
ArchivedSession(it, sessionBundle, sessionBundle.lastSavedAt, sessionBundle.urls)
}
}
}
getManagedEmitter<SessionsChange>().onNext(SessionsChange.Changed(archivedSessions))
})