{paths.map((path) => {
const style = `--offset-path: path('${path}');`;
+ if (isLottie) {
+ return (
+
+ );
+ }
+
return (

= ({
);
};
-export default memo(CustomReactionAnimation);
+export default memo(CustomEmojiEffect);
function generateRandomDropPath() {
const x = (10 + Math.random() * 60) * (Math.random() > 0.5 ? 1 : -1);
diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx
index 6c88eca76..79bdb4bb0 100644
--- a/src/components/middle/message/Message.tsx
+++ b/src/components/middle/message/Message.tsx
@@ -113,6 +113,7 @@ import useOuterHandlers from './hooks/useOuterHandlers';
import useInnerHandlers from './hooks/useInnerHandlers';
import useAppLayout from '../../../hooks/useAppLayout';
import useResizeObserver from '../../../hooks/useResizeObserver';
+import useThrottledCallback from '../../../hooks/useThrottledCallback';
import Button from '../../ui/Button';
import Avatar from '../../common/Avatar';
@@ -252,6 +253,7 @@ const APPEARANCE_DELAY = 10;
const NO_MEDIA_CORNERS_THRESHOLD = 18;
const QUICK_REACTION_SIZE = 1.75 * REM;
const BOTTOM_FOCUS_SCROLL_THRESHOLD = 5;
+const THROTTLE_MS = 300;
const Message: FC
= ({
message,
@@ -613,7 +615,9 @@ const Message: FC = ({
}
}, [focusLastMessage]);
- useResizeObserver(shouldFocusOnResize ? ref : undefined, handleResize, true);
+ const throttledResize = useThrottledCallback(handleResize, [handleResize], THROTTLE_MS, false);
+
+ useResizeObserver(shouldFocusOnResize ? ref : undefined, throttledResize);
useEffect(() => {
const bottomMarker = bottomMarkerRef.current;
diff --git a/src/components/middle/message/ReactionAnimatedEmoji.tsx b/src/components/middle/message/ReactionAnimatedEmoji.tsx
index 0f7e19798..d8cecc21f 100644
--- a/src/components/middle/message/ReactionAnimatedEmoji.tsx
+++ b/src/components/middle/message/ReactionAnimatedEmoji.tsx
@@ -21,7 +21,7 @@ import useCustomEmoji from '../../common/hooks/useCustomEmoji';
import CustomEmoji from '../../common/CustomEmoji';
import ReactionStaticEmoji from '../../common/ReactionStaticEmoji';
import AnimatedSticker from '../../common/AnimatedSticker';
-import CustomReactionAnimation from './CustomReactionAnimation';
+import CustomEmojiEffect from './CustomEmojiEffect';
import styles from './ReactionAnimatedEmoji.module.scss';
@@ -136,7 +136,7 @@ const ReactionAnimatedEmoji: FC = ({
onEnded={handleEnded}
/>
{isCustom ? (
- !assignedEffectId && isIntersecting &&
+ !assignedEffectId && isIntersecting &&
) : (
= ({