Skip to content

Commit 2fb6f0c

Browse files
committed
fix dismiss now
1 parent a0e05d2 commit 2fb6f0c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

app/src/main/java/one/mixin/android/ui/home/ConversationListFragment.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,13 +747,20 @@ class ConversationListFragment : LinkFragment() {
747747
if (isAdded) {
748748
ReminderBottomSheetDialogFragment.getType(requireContext(), totalUsd)
749749
.let { type ->
750-
(parentFragmentManager.findFragmentByTag(ReminderBottomSheetDialogFragment.TAG) as? ReminderBottomSheetDialogFragment)?.dismissNow()
751-
if (type != null) ReminderBottomSheetDialogFragment.newInstance(type).show(parentFragmentManager, ReminderBottomSheetDialogFragment.TAG)
750+
val existingDialog = parentFragmentManager.findFragmentByTag(ReminderBottomSheetDialogFragment.TAG) as? ReminderBottomSheetDialogFragment
751+
existingDialog?.dismiss() // Use dismiss() instead of dismissNow()
752+
753+
if (type != null) {
754+
if (parentFragmentManager.findFragmentByTag(ReminderBottomSheetDialogFragment.TAG) == null) {
755+
ReminderBottomSheetDialogFragment.newInstance(type).show(parentFragmentManager, ReminderBottomSheetDialogFragment.TAG)
756+
}
757+
}
752758
}
753759
}
754760
}
755761
}
756762

763+
757764
private fun openCamera(scan: Boolean) {
758765
RxPermissions(requireActivity())
759766
.request(Manifest.permission.CAMERA)

0 commit comments

Comments
 (0)