From 8177d9777ccd9df18d6e222aa48a19e8e8a3cb54 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Mon, 12 Sep 2022 12:26:57 -0400 Subject: [PATCH 1/3] Fixes crash on double click of space fabs --- .../im/vector/app/features/home/NewHomeDetailFragment.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt index 3681ba4c15..f31f8a7d92 100644 --- a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt @@ -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) } } From db83099dc353242e5619f57b809d074f4467aad3 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Mon, 12 Sep 2022 12:29:33 -0400 Subject: [PATCH 2/3] Adds changelog file --- changelog.d/7102.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/7102.bugfix diff --git a/changelog.d/7102.bugfix b/changelog.d/7102.bugfix new file mode 100644 index 0000000000..73d1bbc7d6 --- /dev/null +++ b/changelog.d/7102.bugfix @@ -0,0 +1 @@ +Fixes crash when quickly double clicking FABs in the new app layout From 34303c4a62703d9354fa4821c1c875ac5c89d38b Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Tue, 13 Sep 2022 16:27:29 -0400 Subject: [PATCH 3/3] Removes inject constructor in NewChatBottomSheet --- .../app/features/home/room/list/home/NewChatBottomSheet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/home/NewChatBottomSheet.kt b/vector/src/main/java/im/vector/app/features/home/room/list/home/NewChatBottomSheet.kt index 05b86f7393..1d8a70c3bb 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/home/NewChatBottomSheet.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/home/NewChatBottomSheet.kt @@ -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