Merge pull request #7102 from vector-im/feature/eric/double-space-click-fix

Fixes Crash On Double Click Of Space FABs
This commit is contained in:
Benoit Marty 2022-09-14 10:15:08 +02:00 committed by GitHub
commit 8dbfafb324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

1
changelog.d/7102.bugfix Normal file
View File

@ -0,0 +1 @@
Fixes crash when quickly double clicking FABs in the new app layout

View File

@ -201,13 +201,12 @@ class NewHomeDetailFragment :
private fun setupFabs() {
showFABs()
views.newLayoutCreateChatButton.setOnClickListener {
newChatBottomSheet.show(requireActivity().supportFragmentManager, NewChatBottomSheet.TAG)
views.newLayoutCreateChatButton.debouncedClicks {
newChatBottomSheet.takeIf { !it.isAdded }?.show(requireActivity().supportFragmentManager, NewChatBottomSheet.TAG)
}
views.newLayoutOpenSpacesButton.setOnClickListener {
// Click action for open spaces modal goes here
spaceListBottomSheet.show(requireActivity().supportFragmentManager, SpaceListBottomSheet.TAG)
views.newLayoutOpenSpacesButton.debouncedClicks {
spaceListBottomSheet.takeIf { !it.isAdded }?.show(requireActivity().supportFragmentManager, SpaceListBottomSheet.TAG)
}
}

View File

@ -27,7 +27,7 @@ import im.vector.app.features.navigation.Navigator
import javax.inject.Inject
@AndroidEntryPoint
class NewChatBottomSheet @Inject constructor() : BottomSheetDialogFragment() {
class NewChatBottomSheet : BottomSheetDialogFragment() {
@Inject lateinit var navigator: Navigator