Skip to content

Commit

Permalink
fix: Do not open scheduled draft on long press
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyDL-Infomaniak authored and KevinBoulongne committed Feb 19, 2025
1 parent e8a1615 commit e29a69d
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,15 @@ class ThreadListAdapter @Inject constructor(

multiSelection?.let { listener ->
selectionCardView.setOnLongClickListener {
onThreadClickWithAbilityToOpenMultiSelection(thread, position, listener, TrackerAction.LONG_PRESS)
onThreadClickWithAbilityToOpenMultiSelection(thread, listener, TrackerAction.LONG_PRESS)
true
}
expeditorAvatar.apply {
setOnClickListener {
onThreadClickWithAbilityToOpenMultiSelection(thread, position, listener, TrackerAction.CLICK)
onThreadClickWithAbilityToOpenMultiSelection(thread, listener, TrackerAction.CLICK)
}
setOnLongClickListener {
onThreadClickWithAbilityToOpenMultiSelection(thread, position, listener, TrackerAction.LONG_PRESS)
onThreadClickWithAbilityToOpenMultiSelection(thread, listener, TrackerAction.LONG_PRESS)
true
}
}
Expand Down Expand Up @@ -319,14 +319,10 @@ class ThreadListAdapter @Inject constructor(

private fun CardviewThreadItemBinding.onThreadClickWithAbilityToOpenMultiSelection(
thread: Thread,
position: Int,
listener: MultiSelectionListener<Thread>,
action: TrackerAction,
) {
if (isMultiselectDisabledInThisFolder) {
onThreadClicked(thread, position)
return
}
if (isMultiselectDisabledInThisFolder) return

val hasOpened = openMultiSelectionIfClosed(listener, action)
toggleMultiSelectedThread(thread, shouldUpdateSelectedUi = !hasOpened)
Expand Down

0 comments on commit e29a69d

Please sign in to comment.