Skip to content

Commit 5dcc336

Browse files
committed
Fixed items getting stuck when swiping them away
1 parent 7652169 commit 5dcc336

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/SwipeableFeedItemPreview.kt

+2-7
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ fun SwipeableFeedItemPreview(
9292
val coroutineScope = rememberCoroutineScope()
9393
val isRtl = LocalLayoutDirection.current == LayoutDirection.Rtl
9494
val swipeableState = rememberSwipeableState(initialValue = FeedItemSwipeState.NONE)
95-
var ignoreSwipes by remember {
96-
mutableStateOf(false)
97-
}
9895

9996
val color by animateColorAsState(
10097
targetValue =
@@ -108,13 +105,11 @@ fun SwipeableFeedItemPreview(
108105

109106
LaunchedEffect(filter, item.unread) {
110107
// critical state changes - reset ui state
111-
ignoreSwipes = true
112108
swipeableState.animateTo(FeedItemSwipeState.NONE)
113-
ignoreSwipes = false
114109
}
115110

116-
LaunchedEffect(swipeableState.currentValue) {
117-
if (!ignoreSwipes && swipeableState.currentValue != FeedItemSwipeState.NONE) {
111+
LaunchedEffect(swipeableState.currentValue, swipeableState.isAnimationRunning) {
112+
if (!swipeableState.isAnimationRunning && swipeableState.currentValue != FeedItemSwipeState.NONE) {
118113
logDebug(LOG_TAG, "onSwipe ${item.unread}")
119114
onSwipe(item.unread)
120115
}

0 commit comments

Comments
 (0)