From 4e6b68370826d2027e13e810aa479faa01371627 Mon Sep 17 00:00:00 2001 From: Test Date: Tue, 30 Jun 2026 13:01:52 +0200 Subject: [PATCH] fix: remove unused preview success animation scales --- .../usePreviewMessageAnimation.ts | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/usePreviewMessageAnimation.ts b/src/components/ReportActionItem/MoneyRequestReportPreview/usePreviewMessageAnimation.ts index b1df30b48f42..8817d3c0c40a 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/usePreviewMessageAnimation.ts +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/usePreviewMessageAnimation.ts @@ -1,6 +1,6 @@ import {useEffect, useMemo} from 'react'; import type {OnyxEntry} from 'react-native-onyx'; -import {useAnimatedStyle, useSharedValue, withDelay, withSpring, withTiming} from 'react-native-reanimated'; +import {useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; import useLocalize from '@hooks/useLocalize'; import {getInvoicePayerName} from '@libs/ReportNameUtils'; import {getDisplayNameForParticipant, getPolicyName} from '@libs/ReportUtils'; @@ -72,8 +72,7 @@ type UsePreviewMessageAnimationParams = { /** * Owns the preview-message animations: the opacity flash that fires whenever the computed preview message changes, - * and the checkmark / thumbs-up spring animations that play on settle / approval. Returns the animated style applied - * to the report name container. + * and returns the animated style applied to the report name container. */ function usePreviewMessageAnimation({ isScanning, @@ -103,8 +102,6 @@ function usePreviewMessageAnimation({ const previewMessageStyle = useAnimatedStyle(() => ({ opacity: previewMessageOpacity.get(), })); - const checkMarkScale = useSharedValue(iouSettled ? 1 : 0); - const thumbsUpScale = useSharedValue(isApproved ? 1 : 0); const previewMessage = useMemo(() => { if (isScanning) { @@ -181,22 +178,6 @@ function usePreviewMessageAnimation({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [previewMessage, previewMessageOpacity]); - useEffect(() => { - if (!iouSettled) { - return; - } - - checkMarkScale.set(isPaidAnimationRunning ? withDelay(CONST.ANIMATION_PAID_CHECKMARK_DELAY, withSpring(1, {duration: CONST.ANIMATION_PAID_DURATION})) : 1); - }, [isPaidAnimationRunning, iouSettled, checkMarkScale]); - - useEffect(() => { - if (!isApproved) { - return; - } - - thumbsUpScale.set(isApprovedAnimationRunning ? withDelay(CONST.ANIMATION_THUMBS_UP_DELAY, withSpring(1, {duration: CONST.ANIMATION_THUMBS_UP_DURATION})) : 1); - }, [isApproved, isApprovedAnimationRunning, thumbsUpScale]); - return {previewMessageStyle}; }