From 307be5c75e96cd7b9c6c728188c6c52ba3d25c5d Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Mon, 16 May 2022 13:12:33 -0300 Subject: [PATCH] Ensure callback is registered for shaking gifts. --- .../badges/gifts/OpenableGiftItemDecoration.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/badges/gifts/OpenableGiftItemDecoration.kt b/app/src/main/java/org/thoughtcrime/securesms/badges/gifts/OpenableGiftItemDecoration.kt index 1ac554174a..c7cc21b41b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/badges/gifts/OpenableGiftItemDecoration.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/badges/gifts/OpenableGiftItemDecoration.kt @@ -72,17 +72,17 @@ class OpenableGiftItemDecoration(context: Context) : RecyclerView.ItemDecoration notAnimated.filterNot { messageIdsOpenedThisSession.contains(it.getGiftId()) }.forEach { child -> val projection = child.getOpenableGiftProjection(false) if (projection != null) { - if (messageIdsShakenThisSession.contains(child.getGiftId())) { - child.setOpenGiftCallback { - child.clearOpenGiftCallback() - val proj = it.getOpenableGiftProjection(true) - if (proj != null) { - messageIdsOpenedThisSession.add(it.getGiftId()) - startOpenAnimation(it) - parent.invalidate() - } + child.setOpenGiftCallback { + child.clearOpenGiftCallback() + val proj = it.getOpenableGiftProjection(true) + if (proj != null) { + messageIdsOpenedThisSession.add(it.getGiftId()) + startOpenAnimation(it) + parent.invalidate() } + } + if (messageIdsShakenThisSession.contains(child.getGiftId())) { drawGiftBox(c, projection) drawGiftBow(c, projection) } else {