Skip to content

Commit

Permalink
fix: Do not open scheduled draft on long press (#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyDL-Infomaniak authored Feb 20, 2025
2 parents d02b5e2 + fb3279b commit b77ba3c
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 b77ba3c

Please sign in to comment.