Fixes #6341: Initialize 'selectedTabs' based on opened/selected tabs.
The problem was that the parameter 'selectedTabIds' was not taken into account when initializing the variable 'selectedTabs'. So I made the initialization based on both the selected tab and the number of open tabs.
This commit is contained in:
parent
da521bc37c
commit
34959a434f
|
@ -47,7 +47,12 @@ class CollectionCreationFragment : DialogFragment() {
|
|||
val sessionManager = requireComponents.core.sessionManager
|
||||
val publicSuffixList = requireComponents.publicSuffixList
|
||||
val tabs = sessionManager.getTabs(args.tabIds, publicSuffixList)
|
||||
val selectedTabs = if (tabs.size == 1) setOf(tabs.first()) else emptySet()
|
||||
val selectedTabs = if (args.selectedTabIds != null) {
|
||||
sessionManager.getTabs(args.selectedTabIds, publicSuffixList).toSet()
|
||||
} else {
|
||||
if (tabs.size == 1) setOf(tabs.first()) else emptySet()
|
||||
}
|
||||
|
||||
val tabCollections = requireComponents.core.tabCollectionStorage.cachedTabCollections
|
||||
val selectedTabCollection = args.selectedTabCollectionId
|
||||
.let { id -> tabCollections.firstOrNull { it.id == id } }
|
||||
|
|
Loading…
Reference in New Issue
Block a user